2017 AIME I Problem 2

When each of 702,787 , and 855 is divided by the positive integer m, the remainder is always the positive integer r. When each of 412,722, and 815 is divided by the positive integer n, the remainder is always the positive integer s \neq r. Find m+n+r+s.