import java.util.Scanner;
public class YueShuBeiShu {
public static int zuida(int i,int j){
int temp;
while(i%j!=0){
temp=i%j;
i=j;
j=temp;
}
return j;
}
public static int zuixiao(int i,int j){
return i*j/zuida(i,j);
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("请输入第一个数:");
int i=sc.nextInt();
System.out.println("请输入第二个数:");
int j=sc.nextInt();
System.out.println("最大约数:"+zuida(i,j));
System.out.println("最大约数:"+zuixiao(i,j));
}
}