#include <bits/stdc++.h>
using namespace std;
int l, r;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> l >> r;
  if (l != r) {
    cout << 2 << endl;
  } else {
    cout << l << endl;
  }
}
