#include <iostream>
using namespace std;
int main(void){
   int x, y, temp;
   if (x < y){
       temp = x;
       x = y;
       y = temp;
   }
   
   while (y != 0){
       temp = y;
        y = x % y;
        x = temp;
   }
   return 0;
}

