#include //#include using namespace std; //using namespace atcoder; typedef long long ll; typedef pair P; //typedef modint1000000007 mint; ll gcd(ll a,ll b){ if(b==0) return a; return gcd(b,a%b); } int main(void){ cin.tie(0); ios::sync_with_stdio(0); ll a,b; cin>>a>>b; ll g=gcd(a,b); cout<