Write down the solution for this math problem: Solve 45*g - 144 = 161*g + 1010 + 3370 for g.
-39