#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const int N = 1e6 + 5;
int main() {
  int l, r;
  cin >> l >> r;
  if (l == r)
    cout << l << endl;
  else
    cout << 2 << endl;
  return 0;
}
