in reply to Can I have some simple solution

This might have made more sense had the posting date been "April 1" instead of "April 10".

That being said, the root of any problem that might be present lies in the initial values of the parameters presented to the modulus operator. If I may paraphrase Asimov, the solution is left as an exercise for the OP.

It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.