Step 1: Recall the first law of thermodynamics.
Energy is conserved through $\Delta U = Q - W$, but here it is cleaner to track internal energy directly. The total internal energy change of the gas over the whole path is given as $\Delta U_{total} = -30\ J$.
Step 2: Note internal energy in isothermal steps.
For an ideal gas, temperature alone fixes internal energy. In an isothermal process the temperature is constant, so $\Delta U = 0$ for each isothermal expansion.
Step 3: Conclude where the internal energy changes.
Since both isothermal steps contribute zero, the entire internal energy change of $-30\ J$ happens during the adiabatic step. So \[ \Delta U_{adiabatic} = -30\ J \]
Step 4: Apply the first law to the adiabatic step.
An adiabatic process has no heat exchange, $Q = 0$, so \[ \Delta U = Q - W = -W \]
Step 5: Solve for the adiabatic work.
\[ -30 = -W \] \[ W = 30\ J \]
Step 6: State the answer.
The work done by the gas during the adiabatic expansion is $30\ J$, matching option (3). The $50\ J$ and $20\ J$ isothermal works are not needed because they leave internal energy unchanged. \[ \boxed{30\ J} \]