#include <iostream>
using namespace std;
int main() {
long long int a, b, c=1, d=0;
while (cin >> a >> b) {
if (a>b) {
while (c!=(b+1)) {
if ((a%c==0)&&(b%c==0)) {
d = c;
c++;
}
else if (((a%c!=0)&&(b%c!=0))|((a%c!=0)&&(b%c==0))|((a%c==0)&&(b%c!=0))) {
c++;
}
}
cout << d << endl;
c = 1;
}
else if (b>a) {
while (c!=(a+1)) {
if ((a%c==0)&&(b%c==0)) {
d = c;
c++;
}
else if (((a%c!=0)&&(b%c!=0))|((a%c!=0) &&(b%c==0))|((a%c==0)&&(b%c!=0))) {
c++;
}
}
cout << d << endl;
c = 1;
}
}
}