public class a15 {
public static void main(String[] args) {
java.util.Scanner scanner=new java.util.Scanner(System.in);
while(scanner.hasNext()) {
int m=scanner.nextInt();
int n=scanner.nextInt();
int sum=0;
if(m>n) {
for(int i=n;i>0;i--) {
if(m%i==0 && n%i==0) {
System.out.print(i);
sum=sum+1;
}
if(sum==1) {
break;
}
}
}else {
for(int i=m;i>0;i--) {
if(m%i==0 && n%i==0) {
System.out.print(i);
sum=sum+1;
}
if(sum==1) {
break;
}
}
}
}
}
}