#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int l, r;
  cin >> l >> r;
  if (l == r) {
    if (r % 2 != 0) {
      cout << r << endl;
      return 0;
    }
  }
  cout << 2 << endl;
  return 0;
}
