#include <iostream> int mcd(int a, int b) { int t; while (b!=0){ t=b; b=a % b; a=t; } return a; } main () { int a,b; std::cin>>a>>b; a=mcd(a,b); std::cout<<a; }