#include<iostream> using namespace std; int gcd(int a,int b){ int r; if(a>b)swap(a,b); while(a!=0){ r=b%a; b=a; a=r; } return b; } int main(){ int a,b; cin>>a>>b; cout<<gcd(a,b); return 0; }