import java.util.Arrays;
import java.util.Scanner;
public class GCD {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
int[] in = {0,0};
for(int i=0;i<2;i++){
in[i]= sc.nextInt();
}
Arrays.sort(in);
int max=in[in.length-1];
int min=in[0];
int GCD=1;
for(int i=1;i<=min;i++){
if(min%i==0){
if(max%i==0){
GCD=i;
}
}
}
System.out.println(GCD);
}
}
}