Look at the operations performed on h. They are (in order) ...
- multiply by 3
- subtract j
- divide the difference by j
To solve for h, we undo these operations in the reverse order.
- multiply by j: gj = 3h -j
- add j: gj+j = 3h
- divide by 3: (gj +j)/3 = h
The desired equation is ...
... h = (g·j + j)/3