Let
x -----> number of orange balls
y -----> number of green balls
we have that
x+y=123 -----> x=123-y ------> equation A
y=5x+9 -----> equation B
Solve the system of equations
substitute equation A in equation B
y=5(123-y)+9
solve for y
y=615-5y+9
y+5y=615+9
6y=624
y=104
Find out the value of x
x=123-104
x=19
therefore
There are 19 orange balls and 104 green balls in the box