#include <cstdio>
#include <algorithm>
using namespace std;
int a,b;
int main(){
  while(scanf("%d %d",&a,&b)!=EOF){
    for(int i=min(a,b);i>0;i--){
      if(a%i==0 && b%i==0){
        printf("%d\n",i);
        break;
      }
    }
  }
return 0;
}