#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
int main(void) {
  ios_base::sync_with_stdio(false);
  int l, r;
  cin >> l >> r;
  if (l == r)
    cout << l << endl;
  else
    cout << 2 << endl;
  return 0;
}
