#include<iostream> using namespace std; int gcd(int a, int b){
} int main(){ int n,m; cin >> n >> m; cout << gcd(n, m); return 0; }