This is a problem in simultaneous or coupled equations, that is not as bad as it seems.

So I will give you a start

Assume constant deceleration in all cases.

Let
v0 be the approach velocity of the bullet in all cases.
-a1 be the deceleration in wood
-a2 be the deceleration in the wall
-a3 be the deceleration in water

Then using \(\displaystyle {v^2} = {u^2} + 2as\) and the information about the distances which each bring the bullet to a standstill

\(\displaystyle 0 = v_0^2 - 2{a_1}*50\)

\(\displaystyle 0 = v_0^2 - 2{a_2}*30\)

\(\displaystyle 0 = v_0^2 - 2{a_3}*100\)

or

\(\displaystyle 100{a_1} = 60{a_2} = 200{a_3}\)

Which reduces 4 unknowns to 2.

If we now let
S be the unknown distance in water to be found can you generate some more equations to solve this?