Gapplet

Given a1, m1, a2, m2, N, we find x N, such that x = a1 mod m1 and x = a2 mod m2.

Input a1 
Input m1 
Input a2 
Input m2 
 
 
x =