Solve srm502.