import java.util.Scanner;
public class QWEW{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
while (input.hasNext()){
int a=input.nextInt();
int b=input.nextInt();
while (a!=0&&b!=0){
if (a>b){
a%=b;
}else if(a<b){
b%=a;
}
}
System.out.print(a==0?b:a);
System.out.println();
}
}
}
請問要修改哪裡?