#include <bits/stdc++.h>
using namespace std;
int isP(long int hj) {
  long int op;
  for (op = 2; op <= sqrt(hj); op++) {
    if (hj % op == 0) return 0;
  }
  return 1;
}
void swap(int *p, int *q) {
  int tmp = *p;
  *p = *q;
  *q = tmp;
}
int main() {
  long long int v1, v2, c1, c2, jb, minI, min1, dp, p2, p3, ze, fst, lst, min2,
      c, s, sm1, sm2, sm3, sr, sl, l, ln, rz, rn, car, ch, eq, r, shr, ng, d, v,
      curr, spl, fl, z, ev, od, t, m, ct, j, q, k, b, maxI, max1, max2, lt, md,
      prev, a, f, n, xP, xN, w, h, d2, d1, u1, u2, sm, i, p, x, y;
  cin >> l >> r;
  if (l == r && l % 2 != 0)
    cout << l;
  else
    cout << "2";
  return 0;
}
