using namespace std; long long m,n,t; int main() { cin>>m>>n; t=__gcd(abs(m),abs(n)); cout << t; return 0; }
// uoc chung lon nhat