#include <bits/stdc++.h>
using namespace std;
long long ans, k, vmax = 0, vmin = -1, ind, c, start, fin, r, l;
int n;
char s[100];
vector<int> V;
double theta, dif = -1, mdif;
char x;
bool p = true;
int main() {
  cin >> l >> r;
  if (l != r)
    cout << 2;
  else
    cout << l;
}
