#include<iostream> using namespace std; int gcd(int a, int b); int main() { int a,b; cin >> a >> b; cout << gcd(a,b) << endl; return 0; } int gcd(int x, int y) { return x?gcd(y%x,x):y; }