#include <bits/stdc++.h>
using namespace std;
const int mv4[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
const int mv8[8][2] = {{0, 1}, {0, -1}, {1, 0},  {-1, 0},
                       {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
const int inf = (int)1e9;
const char *boo[2] = {"NO", "YES"};
const char *inv = "Impossible";
inline void term(const string &msg = inv) {
  cout << msg << endl;
  exit(0);
}
const char *fin = "in.txt";
const char *fout = "out.txt";
int main() {
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  int n;
  string a, b;
  cin >> a >> b;
  string r = "1";
  if (a == b) r = a;
  cout << r << '\n';
  exit(0);
}
