http://grephysics.net will post complete solutions to GR0177 sometimes late tomorrow (or sometimes in the wee hours of wednesday).

For the time-being, here's the solution I have for this problem:

The lensmaker's formula is $1/d_o+1/d_i=1/f$. For an image on the opposite side of the light, the image distance is taken as positive.

The distance between the object and the first lens is $d_{1o}=40$. $f_1=20$. The lensmaker's formula gives $1/d_{1i}=1/f_1-1/d_{1o}=1/40$. Thus, the image is 40 cm behind the first lens.

The first image forms the object for the second lens. The distance of the first image to the second lens is $40-30=10cm$. Since this image is behind the lens (on the other side of the incident geometric light), the convention in the lensmaker's formula takes this as a \emph{negative} distance. One has, $1/d_{i2}=1/f_2 - 1/d_{o2}=1/10+1/10=2/10=1/5$. Thus, the second image is 5 cm to the right of the second lens.