import java.util.Scanner;
public class df {
//最大公约数,用辗转相除法
public int gcd(int a,int b){
int c;
if(a==b){
return a;
}
if(a<b){
int temp;
temp=a;
a=b;
b=temp;
}
while((c=a%b)!=0){
a=b;
b=c;
}
return b;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
df g=new df();
Scanner sc=new Scanner(System.in);
public class df {
//最大公约数,用辗转相除法
public int gcd(int a,int b){
int c;
if(a==b){
return a;
}
if(a<b){
int temp;
temp=a;
a=b;
b=temp;
}
while((c=a%b)!=0){
a=b;
b=c;
}
return b;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
df g=new df();
Scanner sc=new Scanner(System.in);