import java.util.Scanner;
public class dfd{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
System.out.print("请输入整数X:");
int X=sc.nextInt();
System.out.println();
System.out.print("请输入整数Y:");
int Y=sc.nextInt();
System.out.println(max(X,Y));
}
public static String max(int X,int Y){
int c=(X>=Y)?Y:X;
String str = null;
for(int i=c;i>=1;i--){
if(X%i==0&&Y%i==0){
str = i + "是"+X+"和"+Y+"最大公约数";
break;
}
}
return str;
}
}