Ablihi ang meyn nga menu
Dayon sa Wikipedia Blakbord! Puyde ka mag-eksperimento dinhi. Aron ka makausab, klik dinhi o sa usba sa taas, human hala sige pagsuwat-suwat; unya iklik ang Tipigi ang panid nga buton paghuman nimo. Ang sulod dili permanente dinhi; kini automatik nga limpyohon kada 12 oras, o kon naunahan alisdan sa ubang tester.

Kon duna kay pangutana sa Wikipedya, adtoa ang Wikipedia:Mga Pangutana. Salamat!

Shortcut:
WP:SB

  1. include<bits/stdc++.h>

using namespace std; //int oust=0; typedef vector<long long>LL; istream&operator>>(istream&in,LL&a) {

   a.clear();
   string s;
   cin>>s;
   for(int i=0;i<s.size();++i)
   {
       a.push_back(s[s.size()-i-1]-'0');
   }
   return in;

} ostream&operator<<(ostream&out,LL a) {

   for(int i=a.size()-1;i>=0;--i)cout<<a[i];
   return out;

} bool comp(LL&a,LL&b) {

   if(a.size()==b.size())
   {
       for(int i=b.size()-1;i>=0;--i)
       {
           if(a[i]==b[i])continue;
           else return a[i]<b[i];
       }
       return 0;
   }
   return a.size()<b.size();

} LL operator-(LL a,LL&b) { // cout<<a<<' '<<b<<' '<<oust<<endl; // oust++; // if(oust%20==0)cout<<oust<<" o\n";

   LL c(0,0);
   if(a==b)return c;
   if(a.size()-b.size()>=2)
   {
       LL b2(a.size()-b.size()-1,0);
       b2.insert(b2.end(),b.begin(),b.end());
       return a-b2;
   }
   for(int i=0;i<min(a.size(),b.size());++i)a[i]-=b[i];
   bool ok=0;
   while(!ok)
   {
       ok=1;
       for(int i=0;i<min(a.size(),b.size());++i)
       {
           if(a[i]<0){a[i]+=10;a[i+1]--;ok=0;}
       }
   }
   while(!*--a.end())a.pop_back();
   return a;

} LL gcd(LL a,LL b) {

   if(a==b)return b;
   while(b.size())
   {
       if(comp(a,b))swap(a,b);
       LL a0=a,b0=b;
       a=b0;
       b=a0-b0;
   }
   return a;

} int main() { // freopen("D:\\t.txt","r",stdin);

   LL n,m;
   cin>>n>>m;
   cout<<gcd(n,m)<<endl;
   return 0;

}