Math problem: Solve -1291*d + 790*d = -514*d - 508*d + 38554 for d.
What is the solution?
74