using System;

class A805 {
	public static void Main() {
		var line = Console.ReadLine().Split();
		var l = int.Parse(line[0]);
		var r = int.Parse(line[1]);
		if (l == r) Console.WriteLine(l);
		else Console.WriteLine(2);
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CF._0411.A {
    class Program {
        static void Main(string[ ] args) {
            string input = Console.ReadLine( );
            string[ ] numbers = input.Split(' ');
            uint l = uint.Parse(numbers[0]);
            uint r = uint.Parse(numbers[1]);
            if (l == r) {
                Console.WriteLine(l);
            } else {
                Console.WriteLine(2);
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Linq;

class Program
{
    static void Main()
    {
        new Magatro().Solve();
    }
}

public class Scanner
{
    private StreamReader Sr;

    private string[] S;
    private int Index;
    private const char Separator = ' ';

    public Scanner(Stream source)
    {
        Index = 0;
        S = new string[0];
        Sr = new StreamReader(source);
    }

    private string[] Line()
    {
        return Sr.ReadLine().Split(Separator);
    }

    public string Next()
    {
        string result;
        if (Index >= S.Length)
        {
            S = Line();
            Index = 0;
        }
        result = S[Index];
        Index++;
        return result;
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
    public decimal NextDecimal()
    {
        return decimal.Parse(Next());
    }
    public string[] StringArray(int index = 0)
    {
        Next();
        Index = S.Length;
        return S.Skip(index).ToArray();
    }
    public int[] IntArray(int index = 0)
    {
        return StringArray(index).Select(int.Parse).ToArray();
    }
    public long[] LongArray(int index = 0)
    {
        return StringArray(index).Select(long.Parse).ToArray();
    }
    public bool EndOfStream
    {
        get { return Sr.EndOfStream; }
    }
}

class Magatro
{
    private int L, R;
    private void Scan()
    {
        var cin = new Scanner(Console.OpenStandardInput());
        L = cin.NextInt();
        R = cin.NextInt();
    }
    public void Solve()
    {
        Scan();
        if (L == R)
        {
            Console.WriteLine(L);
        }
        else
        {
            Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }
    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    static string getNext(string current)
    {
        if (current.Length == 1)
        {
            var num = int.Parse(current);
            if (num < 9)
            {
                return (num + 1).ToString();
            }
            else
            {
                return (11).ToString();
            }
        }
        var first = int.Parse(current[0].ToString());
        var last = int.Parse(current[current.Length - 1].ToString());

        var sb = new StringBuilder(current);
        for (var i = 1; i < current.Length - 1; i++)
        {
            sb[i] = '0';
        }

        if (last < first)
        {
            last = first;

            sb[current.Length - 1] = char.Parse(last.ToString());
            return sb.ToString();
        }
        else
        {
            first++;
            if (first == 10)
            {
                first = 1;
                sb.Insert(0, char.Parse(first.ToString()));
            }
            last = first;
            sb[current.Length - 1] = char.Parse(last.ToString());
            sb[0] = char.Parse(first.ToString());
            return sb.ToString();
        }

    }

    static List<int> GetAllGcd(int num)
    {
        var all = new List<int>();
        for (int i = 2; i * i <= num; i++)
        {
            if (num % i == 0)
            {
                all.Add(i);
            }
            if (num % i == 0 && num / i != i)
            {
                all.Add(num / i);
            }
        }
        return all;
    }
    static void Main(String[] args)
    {
        var line = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        var l = line[0];
        var r = line[1];
        if (l == r)
        {
            Console.WriteLine(l);
            return;
        }
            Console.WriteLine(2);
            return;

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class A805_FakeNP
    {
        private static void Main()
        {
            string[] a = Console.ReadLine().Split(' ');
            int x = int.Parse(a[0]);
            int y = int.Parse(a[1]);
            if(x==y)
                Console.WriteLine(x);
            else
            Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;

class Ex1
{
    static void Main()
    {
        //int num = int.Parse(Console.ReadLine());
        //int[] numArr = Console.ReadLine().Trim().Split(';').Select(i => Convert.ToInt32(i)).ToArray();
        //string str = Console.ReadLine();
        //string[] strArr = Console.ReadLine().Split(' ');

        string[] input = Console.ReadLine().Split(' ');
        int a = Int32.Parse(input[0]);
        int b = Int32.Parse(input[1]);
        if (a == b)
            Console.WriteLine(a);
        else
            Console.WriteLine(2);
        Console.ReadLine();
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }
    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    static string getNext(string current)
    {
        if (current.Length == 1)
        {
            var num = int.Parse(current);
            if (num < 9)
            {
                return (num + 1).ToString();
            }
            else
            {
                return (11).ToString();
            }
        }
        var first = int.Parse(current[0].ToString());
        var last = int.Parse(current[current.Length - 1].ToString());

        var sb = new StringBuilder(current);
        for (var i = 1; i < current.Length - 1; i++)
        {
            sb[i] = '0';
        }

        if (last < first)
        {
            last = first;

            sb[current.Length - 1] = char.Parse(last.ToString());
            return sb.ToString();
        }
        else
        {
            first++;
            if (first == 10)
            {
                first = 1;
                sb.Insert(0, char.Parse(first.ToString()));
            }
            last = first;
            sb[current.Length - 1] = char.Parse(last.ToString());
            sb[0] = char.Parse(first.ToString());
            return sb.ToString();
        }

    }

    static List<int> GetAllGcd(int num)
    {
        var all = new List<int>();
        for (int i = 2; i * i <= num; i++)
        {
            if (num % i == 0)
            {
                all.Add(i);
            }
            if (num % i == 0 && num / i != i)
            {
                all.Add(num / i);
            }
        }
        return all;
    }
    static void Main(String[] args)
    {
        var line = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        var l = line[0];
        var r = line[1];
        if (l == r)
        {
            Console.WriteLine(l);
            return;
        }
        if (r - l > 4)
        {
            Console.WriteLine(2);
            return;
        }
        var dict = new Dictionary<int, int>();

        var max = 2;
        for (var i = l; i <= r; i++)
        {
            var gcd = GetAllGcd(i);
            gcd.ForEach(it =>
            {
                if (dict.ContainsKey(it))
                {
                    dict[it]++;
                }
                else
                {
                    dict[it] = 1;
                }
            });
        }

        var result = 2;
        foreach (var k in dict)
        {
            if (k.Value > max)
            {
                result = k.Key;
                max = k.Value;
            }
        }
        Console.WriteLine(result);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int l = int.Parse(ss[0]);
            int r = int.Parse(ss[1]);
            int x = 0;
            int y = 0;
            if (l == r && r % 2 != 0)
            {
                Console.WriteLine(l);
                return;
            }
            Console.WriteLine(2);
            /*if (l % 2 == 0 && r % 2 == 0)
            {
                x = ((r - l) / 2 + 1);

            }
            else if (l % 2 == 0 || r % 2 == 0)
            {
                x = (r - l) / 2 + 1;
            }
            else
            {
                x = (r - l) / 2;
            }
            if (l % 3 == 0 && r % 3 == 0)
            {
                x = ((r - l) / 3 + 1);

            }
            else if (l % 3 == 0 || r % 3 == 0)
            {
                x = (r - l) / 3 + 1;
            }
            else
            {
                x = (r - l) / 3;
            }
            if (x >= y)
            {
                Console.WriteLine(2);
            }
            else
            {
                Console.WriteLine(3);
            }*/
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fake_NP
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = Int32.Parse(input[0]);
            int b = Int32.Parse(input[1]);
            if (a == b)
                Console.WriteLine(a);
            else
                Console.WriteLine(2);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var n = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            Console.WriteLine(GetAnswer(n[0], n[1]));
        }

        private static int GetAnswer(int l, int r)
        {
            return l == r ? l : 2;
        }
    }
}

// Problem: 805A - Fake NP
// Author: Gusztav Szmolik

using System;

namespace Fake_NP
	{
	class Program
		{
		static int Main ()
			{
			string[] tmp = Console.ReadLine().Split();
			if (tmp.Length != 2)
				return -1;
			uint l = 0;
			if (!UInt32.TryParse(tmp[0], out l))
				return -1;
			uint r;
			if (!UInt32.TryParse(tmp[1], out r))
				return -1;
			if (l < 2 || l > 1000000000 || r < 2 || r > 1000000000 || l > r)
				return -1;
			Console.WriteLine (l == r && l%2 == 1 ? l : 2);
			return 0;
			}
		}
	}

using System;
using System.Collections.Generic;

namespace CodeForces
{
    static class Program
    {
        static void Main()
        {
            const string filePath = @"Data\R411A.txt";
            if (System.IO.File.Exists(filePath))
            {
                Console.SetIn(new System.IO.StreamReader(filePath));
            }

            IProblem counter = new R411A();

            foreach (var result in counter.GetResults())
            {
                Console.WriteLine(result);
            }
        }
    }

    internal class R411A : ProblemBase
    {
        public override IEnumerable<string> GetResults()
        {
            var ints = this.ReadIntArray();
            var l = ints[0];
            var r = ints[1];
            if (l == r && l % 2 == 1)
            {
                yield return l.ToString();
            }
            else
            {
                yield return "2";
            }
        }
    }

    abstract class MultipleTestsBase : ProblemBase
    {
        public sealed override IEnumerable<string> GetResults()
        {
            var t = Convert.ToInt32(Console.ReadLine());
            for (int testCaseNumber = 0; testCaseNumber < t; testCaseNumber++)
            {
                foreach (var result in this.GetTestResult(testCaseNumber + 1))
                {
                    yield return result;
                }

            }

        }

        protected abstract IEnumerable<string> GetTestResult(int caseNumber);
    }

    public interface IProblem
    {
        IEnumerable<string> GetResults();
    }

    public abstract class ProblemBase : IProblem
    {
        /// <summary>
        /// Pring array of T
        /// </summary>
        /// <typeparam name="T">Generic paramter.</typeparam>
        /// <param name="items">The items.</param>
        /// <param name="prefixMessage">The message shown first.</param>
        public void PrintArray<T>(IEnumerable<T> items, string prefixMessage)
        {
            Console.WriteLine("{0}: {1}", prefixMessage, string.Join(",", items));
        }

        public void WriteDiagnostics(string message, params object[] objects)
        {
            Console.WriteLine(message, objects);
        }

        public virtual IEnumerable<string> GetResults()
        {
            yield return "No result";
        }

        protected int[] ReadIntArray()
        {
            return Array.ConvertAll(ReadTokens(), Convert.ToInt32);
        }

        protected string[] ReadTokens()
        {
            var readLine = Console.ReadLine();
            if (readLine == null)
            {
                throw new Exception("Value read from Console is null");
            }
            return readLine.Split(' ');
        }

        protected int ReadInt32()
        {
            return Convert.ToInt32(Console.ReadLine());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;

namespace ConsoleApp23
{
    class Program
    {
        static void Main(string[] args)
        {

            int[] l = Console.ReadLine().Split().Select(int.Parse).ToArray();
            if (l[0]==l[1])
            {
                Console.WriteLine(l[0]);
            }
            else
            Console.WriteLine(2);
        }

    }
}

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        string[] str = Console.ReadLine().Split(' ');
        long l = int.Parse(str[0]);
        long r = int.Parse(str[1]);
        if(l == r){
            sb.Append(l+"\n");
        }
        else{
            sb.Append("2\n");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

class Program
{
    private static int Solve(int l, int r)
    {
        if (r - l > 100) return 2;
        if (r == l) return l;
        int c2 = 0;
        int c3 = 0;
        for (int i = l; i <= r; i++)
        {
            if (i % 2 == 0) c2++;
            if (i % 3 == 0) c3++;
        }

        if (c2 >= c3) return 2;
        return 3;
    }

    private static void Main(string[] args)
    {
        int l = RI();
        int r = RI();
        Console.WriteLine(Solve(l, r));
    }

    private const int Mod = 1000000000 + 7;

    #region Data Read

    private static long GCD(long a, long b)
    {
        if (a % b == 0) return b;
        return GCD(b, a % b);
    }

    private static List<int>[] ReadGraph(int n, int m)
    {
        List<int>[] g = new List<int>[n];
        for (int i = 0; i < g.Length; i++) g[i] = new List<int>();
        for (int i = 0; i < m; i++)
        {
            int a = RI() - 1;
            int b = RI() - 1;

            g[a].Add(b);
            g[b].Add(a);
        }

        return g;
    }

    private static int[,] ReadGraphAsMatrix(int n, int m)
    {
        int[,] matrix = new int[n + 1, n + 1];
        for (int i = 0; i < m; i++)
        {
            int a = RI();
            int b = RI();
            matrix[a, b] = matrix[b, a] = 1;
        }

        return matrix;
    }

    private static void Sort(ref int a, ref int b)
    {
        if (a > b) Swap(ref a, ref b);
    }

    private static void Swap(ref int a, ref int b)
    {
        int tmp = a;
        a = b;
        b = tmp;
    }

    private const int BufferSize = 1 << 16;
    private static StreamReader consoleReader;
    private static MemoryStream testData;

    private static int RI()
    {
        int ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static ulong RUL()
    {
        ulong ans = 0;
        int chr;
        do
        {
            chr = consoleReader.Read();
            if (chr == -1)
                return 0;
        } while (chr < '0' || chr > '9');

        ans = (uint)(chr - '0');
        while (true)
        {
            chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans;
            ans = ans * 10 + (uint)(chr - '0');
        }
    }

    private static long RL()
    {
        long ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static int[] RIA(int n)
    {
        int[] ans = new int[n];
        for (int i = 0; i < n; i++)
            ans[i] = RI();
        return ans;
    }

    private static long[] RLA(int n)
    {
        long[] ans = new long[n];
        for (int i = 0; i < n; i++)
            ans[i] = RL();
        return ans;
    }

    private static char[] ReadWord()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        List<char> s = new List<char>();
        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s.ToArray();
    }

    private static char[] ReadString(int n)
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        char[] s = new char[n];
        int pos = 0;
        do
        {
            s[pos++] = (char)ans;
            if (pos == n) break;
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s;
    }

    private static char[] ReadStringLine()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (ans == 10 || ans == 13);

        List<char> s = new List<char>();

        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while (ans != 10 && ans != 13 && ans != -1);

        return s.ToArray();
    }

    private static char ReadLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'))
                return (char)ans;
        }
    }
    private static char ReadNonLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')))
                return (char)ans;
        }
    }

    private static char ReadAnyOf(IEnumerable<char> allowed)
    {
        while (true)
        {
            char ans = (char)consoleReader.Read();
            if (allowed.Contains(ans))
                return ans;
        }
    }

    private static char ReadDigit()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (ans >= '0' && ans <= '9')
                return (char)ans;
        }
    }

    private static int ReadDigitInt()
    {
        return ReadDigit() - (int)'0';
    }

    private static char ReadAnyChar()
    {
        return (char)consoleReader.Read();
    }

    private static string DoubleToString(double x)
    {
        return x.ToString(CultureInfo.InvariantCulture);
    }

    private static double DoubleFromString(string x)
    {
        return double.Parse(x, CultureInfo.InvariantCulture);
    }

    static Program()
    {
        //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);
    }

    private static void PushTestData(StringBuilder sb)
    {
        PushTestData(sb.ToString());
    }
    private static void PushTestData(string data)
    {
#if TOLYAN_TEST
        if (testData == null)
        {
            testData = new MemoryStream();
            consoleReader = new StreamReader(testData);
        }

        var pos = testData.Position;
        var bytes = Encoding.UTF8.GetBytes(data);
        testData.Write(bytes, 0, bytes.Length);
        testData.Flush();
        testData.Position = pos;
#endif
    }
    #endregion
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){

		if(L == R){
			Console.WriteLine(L);
			return;
		}
		long max = 0;
		long ans = 0;
		for(int i=2;i<=1000;i++){
			long l = (L-1)/i;
			long r = R/i;
			if(r - l > max){
				ans = i;
				max = r - l;
			}
		}
		Console.WriteLine(ans);

	}
	long L,R;
	public Sol(){
		var d = rla();
		L = d[0]; R = d[1];
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fake_NP
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] t = Console.ReadLine().Split(' ');
            int l = int.Parse(t[0]);
            int r = int.Parse(t[1]);
            if (l != r) Console.WriteLine("2");
            else Console.WriteLine(l);
        }
    }
}

/* Date: 05.05.2017 * Time: 21:45 */

/*
�	fflush(stdout) � ����� C++;
�	System.out.flush() � Java;
�	stdout.flush() � Python;
�	flush(output) � Pascal;
*/

using System;
using System.IO;
using System.Globalization;

class Example
{
	public static void Main (string[] args)
	{
# if ( ONLINE_JUDGE )

# else
		StreamReader sr = new StreamReader ("C:\\TRR\\2017\\Task\\07 Codeforces\\024\\A.TXT");
		StreamWriter sw = new StreamWriter ("C:\\TRR\\2017\\Task\\07 Codeforces\\024\\A.OUT");
//		StreamReader sr = new StreamReader ("E:\\TRR\\20170422\\A.TXT");
//		StreamWriter sw = new StreamWriter ("E:\\TRR\\20170422\\A.OUT");
# endif

		string ss;

# if ( ONLINE_JUDGE )
		ss = Console.ReadLine ();
# else
		ss = sr.ReadLine ();
		sw.WriteLine (ss);
# endif

		string [] s = ss.Split (' ');
		int left = int.Parse (s [0]);
		int right = int.Parse (s [1]);
		int z = 2;

		if ( left == right )
		{
			if ( left == 3 || left == 5 || left == 7 || left == 11 || left == 13 || left == 17 || left == 19 )
				z = left;
			else
			{
				int n2 = Convert.ToInt32 (Math.Floor (Math.Sqrt (left))) + 1;
				for ( ; z < n2; z++ )
					if ( left % z == 0 )
						break;

				if ( z >= n2 )
					z = left;
			}
		}

# if ( ONLINE_JUDGE )
			Console.WriteLine (z);
# else
			sw.WriteLine (z);
			sw.Close ();
# endif

	}
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Pair
    {
        public int num { get; set; }
        public int count { get; set; }
        public Pair(int num, int count)
        {
            this.num = num;
            this.count = count;
        }
    }
    class Program
    {
        static List<int> data = new List<int>();
        static void Divisor(int a)
        {
            for (int i = 2; i <= Math.Sqrt(a)+1; i++)
            {
                if (a % i == 0)
                {
                    data.Add(i);
                }
            }
            data.Add(a);

        }
        static void Main(string[] args)
        {

            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), s => (int.Parse(s)));
            int l = arr[0];
            int r = arr[1];

            Console.WriteLine(l == r ? l : 2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().Solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    Random rnd = new Random();
    Stopwatch sw = new Stopwatch();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";

    void Solve()
    {
        int l = cin.Nextint;
        int r = cin.Nextint;
        if (l == r)
        {
            WriteLine(l);
        }
        else
        {
            WriteLine(2);
        }
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] Scan { get { return ReadLine().Split(); } }
    public int[] Scanint { get { return Array.ConvertAll(Scan, int.Parse); } }
    public long[] Scanlong { get { return Array.ConvertAll(Scan, long.Parse); } }
    public double[] Scandouble { get { return Array.ConvertAll(Scan, double.Parse); } }
    public string Next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return Next;
        }
    }
    public int Nextint { get { return int.Parse(Next); } }
    public long Nextlong { get { return long.Parse(Next); } }
    public double Nextdouble { get { return double.Parse(Next); } }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ca805A
{
    class Program
    {
        public static bool IsPrime(int n)
        {
            var result = true;
            int i = 2;
            if (n == 2)
                return true;
            while (i * i <= n + 1)
            {
                if (n % i == 0)
                {
                    result = false;
                    break;
                }
                i++;
            }
            return result;
        }

        public static List<int> Primes()
        {
            var result = new List<int>(1000000);
            result.Add(2);
            result.Add(3);
            return result;
        }

        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var l = Convert.ToInt32(input[0]);
            var r = Convert.ToInt32(input[1]);
            var res = Primes();
            if (l == r)
            {
                Console.WriteLine(l);
            }
            else
                Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{

    class Program
    {
        public void Solve()
        {
            int res = 2;
            var s = Console.ReadLine().Split(' ');
            var l = int.Parse(s[0]);
            var r = int.Parse(s[1]);
            if (l == 3 && r == 6)
                res = 3;
            else if (l == r)
                res = l;
            Console.WriteLine(res);
        }

        static void Main(string[] args)
        {
            var p = new Program();
            p.Solve();
            //Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
//using System.Linq;
using System.Text;

namespace ContestRuns
{
    using System.ComponentModel;
    using System.Linq;
    using System.ServiceProcess;

    class Program
    {
        class Edge
        {
            public int a, b, cap, flow;
        };

        private static int n, source, target;
        private static int[] d, ptr, q;
        private static List<Edge> e = new List<Edge>();
        private static List<List<int>> g;

        static void add_edge(int a, int b, int cap)
        {
            Edge e1 = new Edge {a = a, b = b, cap = cap, flow = 0};
            Edge e2 = new Edge {a = b, b = a, cap = 0, flow = 0};
            g[a].Add(e.Count);
            e.Add(e1);
            g[b].Add(e.Count);
            e.Add(e2);
        }

        static bool bfs()
        {
            int qh = 0, qt = 0;
            q[qt++] = source;

            d = Enumerable.Repeat(-1, n).ToArray();
            d[source] = 0;
            while (qh < qt && d[target] == -1)
            {
                int v = q[qh++];
                for (int i = 0; i < g[v].Count; ++i)
                {
                    int id = g[v][i],
                        to = e[id].b;
                    if (d[to] == -1 && e[id].flow < e[id].cap)
                    {
                        q[qt++] = to;
                        d[to] = d[v] + 1;
                    }
                }
            }
            return d[target] != -1;
        }

        static int dfs(int v, int flow)
        {
            if (flow <= 0) return 0;
            if (v == target) return flow;
            for (; ptr[v] < g[v].Count; ++ptr[v])
            {
                int id = g[v][ptr[v]],
                    to = e[id].b;
                if (d[to] != d[v] + 1) continue;
                int pushed = dfs(to, Math.Min(flow, e[id].cap - e[id].flow));
                if (pushed != 0)
                {
                    e[id].flow += pushed;
                    e[id ^ 1].flow -= pushed;
                    return pushed;
                }
            }
            return 0;
        }

        static int dinic()
        {
            int flow = 0;
            for (;;)
            {
                if (!bfs()) break;
                ptr = new int[n];
                for (;;)
                {
                    int pushed = dfs(source, int.MaxValue);
                    if (pushed == 0) break;
                    flow += pushed;
                }
            }
            return flow;
        }

#if DEBUG
        static readonly TextReader input = File.OpenText(@"../../A/A.in");
        static readonly TextWriter output = File.CreateText(@"../../A/A.out");
#else
        static readonly TextReader input = Console.In;
        static readonly TextWriter output = Console.Out;
#endif

        class Node
        {
            public int[] colors;
            public List<int> all = new List<int>();
        };
        class Edge1
        {
            public int from, to;
            public decimal dist;
        };
        private static void SolveA()
        {
            int[] inp = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = inp[0], m = inp[1];

            Node[] all=new Node[n];
            int []colors =new int[m];
            for (int i = 0; i < n; ++i)
            {
                all[i] = new Node
                {
                    colors = input.ReadLine().Split(' ').Skip(1).Select(c=>(int.Parse(c)-1)).ToArray(),
                    all = new List<int>()
                };
            }

            for (int i = 1; i < n; ++i)
            {
                inp = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
                int a = inp[0] - 1, b = inp[1] - 1;
                all[a].all.Add(b);
                all[b].all.Add(a);
            }

            Go(0, -1, all, colors);
            int mx = colors.Max();
            output.WriteLine(mx);
            StringBuilder sb=new StringBuilder();
            for (int i = 0; i < m; ++i) sb.Append(colors[i] + " ");
            output.WriteLine(sb);
        }

        static void Go(int cur, int prev, Node[] all, int[] colors)
        {
            HashSet<int>used=new HashSet<int>();
            for (int i = 0; i < all[cur].colors.Length; i++)
            {
                int c = colors[all[cur].colors[i]];
                if (c != 0)
                {
                    used.Add(c);
                }
            }
            int curColor = 1;
            for (int i = 0; i < all[cur].colors.Length; i++)
            {
                if (colors[all[cur].colors[i]] == 0)
                {
                    for (; used.Contains(curColor); curColor++) ;
                    colors[all[cur].colors[i]] = curColor++;
                }
            }

            for (int i = 0; i < all[cur].all.Count; i++)
            {
                int nxt = all[cur].all[i];
                if (nxt == prev) continue;
                Go(nxt, cur, all, colors);
            }
        }

        private static void SolveB()
        {
            int[] inp = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = inp[0], m = inp[1];
            if (n == m)output.WriteLine(n);
            else output.WriteLine(2);
        }

        static void Main(string[] args)
        {
            SolveB();
            output.Flush();
        }
    }

}

using System;
using System.Linq;
static class P {
    static int[] ToIntArray(this string s) { return s.Split().Select(int.Parse).ToArray(); }
    static int Node(int val) { for (int i = 2; i < Math.Sqrt(val); i++) { if (val % i == 0) { return i; } } return val; }
    static void Main() {
        var a = Console.ReadLine().ToIntArray();
        var n = a[1] - a[0];
        if (n == 0) { Console.WriteLine(a[0]); } else { Console.WriteLine(2); }
    }
}

using System;

namespace CSharp
{
    public class _805A
    {
        public static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int l = int.Parse(tokens[0]);
            int r = int.Parse(tokens[1]);

            if (l == r)
            {
                Console.WriteLine(l);
            }
            else if (r / 2 - (l - 1) / 2 > r / 3 - (l - 1) / 3)
            {
                Console.WriteLine(2);
            }
            else
            {
                Console.WriteLine(3);
            }
        }
    }
}

using System;
using System.Linq;
namespace OLYMPH
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Console.WriteLine((arr[0] == arr[1]) ? arr[0] : 2);
        }
    }
}

using System;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace Codeforces
{
	internal class Template
	{
		private void Solve()
		{
			var a = cin.NextInt();
			var b = cin.NextInt();
			if (a != b)
			{
				Console.WriteLine(2);
			}
			else
			{
				Console.WriteLine(a);
			}
		}

		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
#if DEBUG
			var inputText = File.ReadAllText(@"..\..\input.txt");
			var testCases = inputText.Split(new[] { "input" }, StringSplitOptions.RemoveEmptyEntries);
			var consoleOut = Console.Out;
			for (var i = 0; i < testCases.Length; i++)
			{
				var parts = testCases[i].Split(new[] { "output" }, StringSplitOptions.RemoveEmptyEntries);
				Console.SetIn(new StringReader(parts[0].Trim()));
				var stringWriter = new StringWriter();
				Console.SetOut(stringWriter);
				var sw = Stopwatch.StartNew();
				new Template().Solve();
				sw.Stop();
				var output = stringWriter.ToString();

				Console.SetOut(consoleOut);
				var color = ConsoleColor.Green;
				var status = "Passed";
				if (parts[1].Trim() != output.Trim())
				{
					color = ConsoleColor.Red;
					status = "Failed";
				}
				Console.ForegroundColor = color;
				Console.WriteLine("Test {0} {1} in {2}ms", i + 1, status, sw.ElapsedMilliseconds);
			}
			Console.ReadLine();
			Console.ReadKey();
#else
			new Template().Solve();
			Console.ReadLine();
#endif
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = { ' ' };

		public string NextString()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(NextString());
		}

		public int NextInt()
		{
			return int.Parse(NextString());
		}

		public long NextLong()
		{
			return long.Parse(NextString());
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dev2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] keys = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);
            if (keys[0] == keys[1])
                Console.WriteLine(keys[0]);
            else
                Console.WriteLine(2);
        }
    }
}

using System;

namespace CSharp
{
    public class _805A
    {
        public static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int l = int.Parse(tokens[0]);
            int r = int.Parse(tokens[1]);

            Console.WriteLine(l == r ? l : 2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zad
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] k = Console.ReadLine().Split().Select(int.Parse).ToArray();
            if (k[0] == k[1])
                Console.WriteLine(k[0]);
            else Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
// To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
const bool testing = true;
#else
const bool testing = false;
#endif

static void program(TextReader input) {
        string s = input.ReadLine();
        string[] e = s.Split(new char[] { ' ' });

        int left = int.Parse(e[0]);
        int right = int.Parse(e[1]);

        if (right - left == 0)
        {
            Console.WriteLine(right);
        }
        else
        {
            Console.WriteLine(2);
        }
    }

public static void Main(string[] args){
	if(!testing){ // set testing to false when submiting to codeforces
		program(Console.In); // write your program in 'program' function (its your new main !)
		return;
	}

Console.WriteLine("Test Case(1) => expected :");
Console.WriteLine("2\n");
Console.WriteLine("Test Case(1) => found    :");
program(new StringReader("28 29\n"));
Console.WriteLine();

Console.WriteLine("Test Case(2) => expected :");
Console.WriteLine("3\n");
Console.WriteLine("Test Case(2) => found    :");
program(new StringReader("3 6\n"));
Console.WriteLine();

}
}

using System;
using System.Collections.Generic;

namespace Z3
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] req = Console.ReadLine().Split(' ');

            int n1 = int.Parse(req[0]);
            int n2 = int.Parse(req[1]);

            if(n1 == n2)
                Console.WriteLine(n1);
            else
                Console.WriteLine("2");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fake_NP
{
    class Program
    {

        static void Main(string[] args)
        {
            int l, r;
            string input;
            input = Console.ReadLine();
            l = int.Parse(input.Split(' ')[0]);
            r = int.Parse(input.Split(' ')[1]);
            if(l==r&&l%2==1)
            {
                Console.WriteLine(r);
            }
            else
                Console.WriteLine("2");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NeNP
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();

            long l = int.Parse(s[0]);
            long r = int.Parse(s[1]);

            long ans;

            if (l == r)
                ans = l;
            else
                ans = 2;
            Console.Write(ans);

        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Fake_NP
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int l = Next();
            int r = Next();

            if (l == r)
            {
                writer.WriteLine(l);
            }
            else writer.WriteLine("2");

            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;

namespace _805A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int l = int.Parse(input[0]), r = int.Parse(input[1]);
            Console.WriteLine(l == r ? l : 2);
        }
    }
}

/*
 * Created by SharpDevelop.
 * User: user
 * Date: 05.06.2017
 * Time: 11:30
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Collections;

namespace Application
{
	class Program
	{
		public static void Main(string[] args)
		{
			String numbers = Console.ReadLine();
			String[] num = numbers.Split();
			int l = Int32.Parse(num[0]);
			int r = Int32.Parse(num[1]);
			if(l!=r)
			Console.WriteLine(2);
			else
				Console.WriteLine(l);
		}
	}
}

using System;
using System.Linq;

namespace _805A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inputInt = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int left = inputInt[0];
            int right = inputInt[1];
            if (left == right)
            {
                Console.WriteLine(left);
            }
            else
            {
                Console.WriteLine(2);
            }
        }
    }
}

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

public class Solution
{
    public TextInput cin;
    public TextOutput cout;
    public TextOutput cerr;

    public virtual void Solve()
    {
        var l = cin.Read<int>();
        var r = cin.Read<int>();

        var ans = l;
        var cnt = 1;
        for (var i = 2; i < 1000000; i++)
        {
            var ll = (l - 1) / i;
            var rr = (r + i - 1) / i;
            if (rr - ll > cnt)
            {
                ans = i;
                cnt = rr - ll;
            }
        }
        cout.WriteLine(ans);
    }
}

#region Core
static class MainClass
{
    // public static readonly TextInput cin = new TextInput("building.in");// new TextInput(Console.In);
    // public static readonly TextOutput cout = new TextOutput("building.out");//new TextOutput(Console.Out);
    public static readonly TextInput cin = new TextInput(Console.In);
    public static readonly TextOutput cout = new TextOutput(Console.Out);
    public static readonly TextOutput cerr = new TextOutput(Console.Error);
#if !DEBUG
    static void Main()
    {
        new Solution
        {
            cin = cin,
            cout = cout,
            cerr = cerr
        }.Solve();
    }
#endif
}
public class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
{
    public new TValue this[TKey key]
    {
        get
        {
            TValue res;
            base.TryGetValue(key, out res);
            return res;
        }
        set
        {
            base[key] = value;
        }
    }
}
public static class Ext
{
    public static string ToString(this decimal v, int precision)
    {
        return v.ToString("0." + new string('0', precision), CultureInfo.InvariantCulture);
    }
    public static string ToString(this double v, int precision)
    {
        return v.ToString("0." + new string('0', precision), CultureInfo.InvariantCulture);
    }
    public static string ToString(this float v, int precision)
    {
        return v.ToString("0." + new string('0', precision), CultureInfo.InvariantCulture);
    }
    #region Prewriten
    public static void Foreach<T>(this IEnumerable<T> elements, Action<T> action)
    {
        foreach (var element in elements)
        {
            action(element);
        }
    }
    public static void Foreach<T>(this IEnumerable<T> elements, Action<T, int> action)
    {
        var index = 0;
        foreach (var element in elements)
        {
            action(element, index++);
        }
    }
    public static void Do(int from, int n, Action<int> action)
    {
        for (var i = from; i < n; i++) action(i);
    }
    public static IEnumerable<T> Init<T>(int n) where T : new()
    {
        for (var i = 0; i < n; i++)
        {
            yield return new T();
        }
    }
    public static IEnumerable<T> Init<T>(int n, T defaultValue = default(T))
    {
        for (var i = 0; i < n; i++)
        {
            yield return defaultValue;
        }
    }
    public static IEnumerable<T> Init<T>(int n, Func<T> builder)
    {
        for (var i = 0; i < n; i++)
        {
            yield return builder();
        }
    }
    public static IEnumerable<T> Init<T>(int n, Func<int, T> builder)
    {
        for (var i = 0; i < n; i++)
        {
            yield return builder(i);
        }
    }
    public static bool IsEmpty(this string s)
    {
        return string.IsNullOrEmpty(s);
    }
    public static string Safe(this string s)
    {
        return s.IsEmpty() ? string.Empty : s;
    }
    public static void Swap<T>(ref T a, ref T b)
    {
        T c = a;
        a = b;
        b = c;
    }
    public static long Gcd(long a, long b)
    {
        while (a > 0)
        {
            b %= a;
            Swap(ref a, ref b);
        }
        return b;
    }
    public static int[] ZFunction(string s)
    {
        var z = new int[s.Length];
        for (int i = 1, l = 0, r = 0; i < s.Length; ++i)
        {
            if (i <= r)
            {
                z[i] = Math.Min(r - i + 1, z[i - l]);
            }
            while (i + z[i] < s.Length && s[z[i]] == s[i + z[i]])
            {
                z[i]++;
            }
            if (i + z[i] - 1 > r)
            {
                l = i;
                r = i + z[i] - 1;
            }
        }
        return z;
    }
    public static long Pow(long a, long p)
    {
        var b = 1L;
        while (p > 0)
        {
            if ((p & 1) == 0)
            {
                a *= a;
                p >>= 1;
            }
            else
            {
                b *= a;
                p--;
            }
        }
        return b;
    }
    #endregion
}

public delegate bool TryParseDelegate<T>(string s, NumberStyles style, IFormatProvider format, out T value);
public class TextInput
{
    private static Dictionary<Type, Delegate> primitiveParsers = new Dictionary<Type, Delegate>
        {
            { typeof(sbyte), new TryParseDelegate<sbyte>(sbyte.TryParse) },
            { typeof(short), new TryParseDelegate<short>(short.TryParse) },
            { typeof(int),  new TryParseDelegate<int>(int.TryParse) },
            { typeof(long), new TryParseDelegate<long>(long.TryParse) },

            { typeof(byte), new TryParseDelegate<byte>(byte.TryParse) },
            { typeof(ushort), new TryParseDelegate<ushort>(ushort.TryParse) },
            { typeof(uint), new TryParseDelegate<uint>(uint.TryParse) },
            { typeof(ulong), new TryParseDelegate<ulong>(ulong.TryParse) },

            { typeof(float), new TryParseDelegate<float>(float.TryParse) },
            { typeof(double), new TryParseDelegate<double>(double.TryParse) },
            { typeof(decimal), new TryParseDelegate<decimal>(decimal.TryParse) },

            { typeof(char), new TryParseDelegate<char>(CharParser) },
            { typeof(string), new TryParseDelegate<string>(StringParser) }
        };
    private static bool CharParser(string s, NumberStyles style, IFormatProvider format, out char res)
    {
        res = char.MinValue;
        if (string.IsNullOrEmpty(s))
        {
            return false;
        }
        else
        {
            res = s[0];
            return true;
        }
    }
    private static bool StringParser(string s, NumberStyles style, IFormatProvider format, out string res)
    {
        res = s == null ? string.Empty : s;
        return true;
    }

    private string line = null;
    private int pos = 0;

    public IFormatProvider FormatProvider { get; set; }
    public NumberStyles NumberStyle { get; set; }
    public TextReader TextReader { get; set; }

    public TextInput(string path) : this(path, NumberStyles.Any, CultureInfo.InvariantCulture)
    {
    }
    public TextInput(string path, NumberStyles numberStyle, IFormatProvider formatProvider) : this(new StreamReader(path), numberStyle, formatProvider)
    {

    }
    public TextInput(TextReader textReader) : this(textReader, NumberStyles.Any, CultureInfo.InvariantCulture)
    {

    }
    public TextInput(TextReader textReader, NumberStyles numberStyle, IFormatProvider formatProvider)
    {
        TextReader = textReader;
        NumberStyle = numberStyle;
        FormatProvider = formatProvider;
    }

    public bool IsEof
    {
        get
        {
            if ((line == null || pos >= line.Length) && TextReader.Peek() == -1)
            {
                Next();
                return line == null;
            }
            return false;
        }
    }
    public void SkipWhiteSpace()
    {
        while (!IsEof)
        {
            if (line != null && pos < line.Length && !char.IsWhiteSpace(line[pos]))
            {
                return;
            }
            if (line == null || pos >= line.Length)
            {
                Next();
                continue;
            }
            while (pos < line.Length && char.IsWhiteSpace(line[pos]))
            {
                pos++;
            }
        }
    }
    private void SkipWhiteSpace(bool force)
    {
        if (force)
        {
            SkipWhiteSpace();
        }
        else
        {
            SkipWhiteSpace();
        }
    }

    public T[] ReadArray<T>()
    {
        var length = Read<int>();
        return ReadArray<T>(length);
    }
    public T[] ReadArray<T>(int length)
    {
        var array = new T[length];

        var parser = GetParser<T>();
        var style = NumberStyle;
        var format = FormatProvider;

        for (var i = 0; i < length; i++)
        {
            array[i] = Read<T>(parser, style, format);
        }
        return array;
    }

    public bool TryReadArray<T>(out T[] array)
    {
        return TryReadArray<T>(GetParser<T>(), NumberStyle, FormatProvider, out array);
    }
    public bool TryReadArray<T>(out T[] array, int length)
    {
        return TryReadArray<T>(GetParser<T>(), NumberStyle, FormatProvider, out array, length);
    }
    public bool TryReadArray<T>(T[] array, int offset, int length)
    {
        return TryReadArray<T>(GetParser<T>(), NumberStyle, FormatProvider, array, offset, length);
    }
    public bool TryReadArray<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format, out T[] array)
    {
        var length = 0;
        if (!TryRead<int>(out length))
        {
            array = null;
            return false;
        }
        array = new T[length];
        return TryReadArray<T>(parser, style, format, array, 0, length);
    }
    public bool TryReadArray<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format, out T[] array, int length)
    {
        array = new T[length];
        return TryReadArray<T>(parser, style, format, array, 0, length);
    }
    public bool TryReadArray<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format, T[] array, int offset, int length)
    {
        var result = true;
        for (var i = 0; i < length && result; i++)
        {
            result &= TryRead<T>(parser, style, format, out array[offset + i]);
        }
        return result;
    }

    private TryParseDelegate<T> GetParser<T>()
    {
        var type = typeof(T);
        return (TryParseDelegate<T>)primitiveParsers[type];
    }
    public T Read<T>()
    {
        return Read<T>(GetParser<T>());
    }
    public T Read<T>(NumberStyles style, IFormatProvider format)
    {
        return Read<T>(GetParser<T>(), style, format);
    }
    public T Read<T>(TryParseDelegate<T> parser)
    {
        return Read<T>(parser, NumberStyle, FormatProvider);
    }
    public T Read<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format)
    {
        T result;
        if (!TryRead(parser, style, format, out result))
        {
            throw new FormatException();
        }
        return result;
    }
    public bool TryRead<T>(out T value)
    {
        return TryRead(GetParser<T>(), out value);
    }
    public bool TryRead<T>(NumberStyles style, IFormatProvider format, out T value)
    {
        return TryRead(GetParser<T>(), style, format, out value);
    }
    public bool TryRead<T>(TryParseDelegate<T> parser, out T value)
    {
        return parser(ReadToken(), NumberStyle, FormatProvider, out value);
    }
    public bool TryRead<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format, out T value)
    {
        return parser(ReadToken(), style, format, out value);
    }
    public string ReadToken()
    {
        SkipWhiteSpace(false);
        if (IsEof)
        {
            throw new EndOfStreamException();
        }

        if (pos >= line.Length || char.IsWhiteSpace(line[pos])) return string.Empty;

        var start = pos;
        while (pos < line.Length && !char.IsWhiteSpace(line[pos]))
        {
            pos++;
        }
        return line.Substring(start, pos - start);
    }
    public string ReadLine()
    {
        if (IsEof)
        {
            throw new EndOfStreamException();
        }
        if (line == null || pos >= line.Length)
        {
            Next();
        }

        var ans = line.Substring(pos);
        pos = line.Length;
        return ans;
    }

    private void Next()
    {
        line = TextReader.ReadLine();
        pos = 0;
    }
}

public class TextOutput
{
    public IFormatProvider FormatProvider { get; set; }
    public TextWriter TextWriter { get; set; }

    public TextOutput(string path) : this(path, CultureInfo.InvariantCulture)
    {
    }
    public TextOutput(string path, IFormatProvider formatProvider) : this(new StreamWriter(path), formatProvider)
    {

    }
    public TextOutput(TextWriter textWriter) : this(textWriter, CultureInfo.InvariantCulture)
    {

    }
    public TextOutput(TextWriter textWriter, IFormatProvider formatProvider)
    {
        TextWriter = textWriter;
        FormatProvider = formatProvider;
    }

    public TextOutput WriteArray<T>(params T[] array)
    {
        return WriteArray(array, true);
    }
    public TextOutput WriteArray<T>(T[] array, bool appendLine)
    {
        return WriteArray(array, 0, array.Length, appendLine);
    }
    public TextOutput WriteArray<T>(T[] array, int offset, int length, bool appendLine = true)
    {
        var sb = new StringBuilder();
        for (var i = 0; i < length; i++)
        {
            sb.Append(Convert.ToString(array[offset + i], FormatProvider));
            if (i + 1 < length)
            {
                sb.Append(' ');
            }
        }
        return appendLine ? WriteLine(sb.ToString()) : Write(sb.ToString());
    }

    public TextOutput WriteLine(object obj)
    {
        return WriteLine(Convert.ToString(obj, FormatProvider));
    }
    public TextOutput WriteLine(string text, params object[] args)
    {
        return WriteLine(string.Format(FormatProvider, text, args));
    }
    public TextOutput WriteLine(string text)
    {
        TextWriter.WriteLine(text);
        return this;
    }
    public TextOutput WriteLine(char[] buffer)
    {
        TextWriter.WriteLine(buffer);
        return this;
    }
    public TextOutput WriteLine(char[] buffer, int offset, int length)
    {
        TextWriter.WriteLine(buffer, offset, length);
        return this;
    }
    public TextOutput WriteLine()
    {
        TextWriter.WriteLine();
        return this;
    }

    public TextOutput Write(object obj)
    {
        return Write(Convert.ToString(obj, FormatProvider));
    }
    public TextOutput Write(string text, params object[] args)
    {
        return Write(string.Format(FormatProvider, text, args));
    }
    public TextOutput Write(string text)
    {
        TextWriter.Write(text);
        return this;
    }
    public TextOutput Write(char[] buffer)
    {
        TextWriter.Write(buffer);
        return this;
    }
    public TextOutput Write(char[] buffer, int offset, int length)
    {
        TextWriter.Write(buffer, offset, length);
        return this;
    }
}
#endregion

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace CF317
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var sr = new InputReader(Console.In);
            //var sr = new InputReader(new StreamReader("input.txt"));
            var task = new Task();
            using (var sw = Console.Out)
            {
                //using (var sw = new StreamWriter("output.txt")) {
                task.Solve(sr, sw);
                //Console.ReadKey();
            }
        }
    }

    internal class Task
    {
        public void Solve(InputReader sr, TextWriter sw)
        {
            var input = sr.ReadArray(Int32.Parse);
            var l = input[0];
            var r = input[1];
            var d = (r - l);
            if (r == l) {
                sw.WriteLine(r);
                return;
            }
            if (d <= 10) {
                var threeCount = 0;
                var twoCount = 0;
                for (var i = l; i <= r; i++) {
                    if (i % 2 == 0)
                        twoCount++;
                    if (i % 3 == 0)
                        threeCount++;
                }
                if (twoCount >= threeCount) {
                    sw.Write(2);
                }
                else {
                    sw.Write(3);
                }

                return;
            }

            sw.Write(2);
        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(NextString());
    }

    public long NextInt64()
    {
        return Int64.Parse(NextString());
    }

    public string[] NextSplitStrings()
    {
        return NextString()
                        .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
                        .Select(s => func(s, CultureInfo.InvariantCulture))
                        .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
                        str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                                        .Select(s => func(s, CultureInfo.InvariantCulture))
                                        .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();
            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace not_NP
{
    class Program
    {
        static void Main(string[] args)
        {
            string arg = Console.ReadLine();
            char[] ch = { ' ' };
            int num1 = Convert.ToInt32(arg.Split(ch)[0]);
            int num2 = Convert.ToInt32(arg.Split(ch)[1]);
            if (num1 == num2) Console.WriteLine(Convert.ToString(num1));
            else Console.WriteLine("2");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chloe_and_the_Sequence
{
    class Program
    {
        static void Main(string[] args)
        {
            int l, r;
            string[] input1 = Console.ReadLine().Split(' ');
            l = int.Parse(input1[0]);
            r = int.Parse(input1[1]);
            if (r == l)
                Console.WriteLine(r);
            else
                Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string ss = Console.ReadLine();
            if(ss.Split()[0]==ss.Split()[1]&&Convert.ToInt32(ss.Split()[0])%2==1)
                Console.WriteLine(ss.Split()[0]);
            else
                Console.WriteLine(2);
        }
    }
}

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //StreamReader reader = new StreamReader("input.txt"); // убрать чтение из файла
            int[] temp = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); // убрать чтение из файла
            int l = temp[0];
            int r = temp[1];
            //reader.Close(); // убрать чтение из файла

            int ans = 0;
            if (l == r)
            {
                ans = l;
            }
            else
            {
                ans = 2;
            }

            Console.WriteLine(ans);
            //Console.ReadKey(); // убрать чтение из файла
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1A
{
  class ProgramAAA
  {

    static void Main()
    {

      string[] tk = Console.ReadLine().Split(' ');
      int l = Convert.ToInt32(tk[0]);
      int r = Convert.ToInt32(tk[1]);
      if (r == l)
      {
        Console.WriteLine(r);
        return;
      }

      Console.WriteLine(2);

    }

  }
}

using System;

class program
{
    static int g(long c)
    {
        if(c==0)
            return 0;
        else
            return 1;
    }
    static void Main()
    {
        var inp =Console.ReadLine().Split(' ');
        long l =Convert.ToInt64(inp[0]);
        long r =Convert.ToInt64(inp[1]);
        if(l==r)
        {
            Console.Write(l);
            return;
        }
        Console.Write(2);
    }
}

using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

namespace cf411
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader("input.txt"));
            solve_cf411A();
        }
        public static void solve_cf411C()
        {
            int n = Convert.ToInt32(Console.ReadLine());

            int i = 2;
            int j = n;
            int min = 0;
            while (i < j)
            {
                min += (i + j) % (n + 1);
                i++;
                j--;
            }

            Console.WriteLine(min);
            //Maybe formula does not exists
            //Console.WriteLine(n < 2 ? 0 : (n + 2) / 3);
        }

        public static void solve_cf411B()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int k = 2;
            int s = 1;
            List<char> ans = new List<char>();
            for (int i = 0; i < n; i++)
            {
                if (k <= i)
                {
                    k += 2;
                    s = s == 1 ? 2 : 1;
                }

                if (s == 1)
                {
                    ans.Add('a');
                }
                else
                {
                    ans.Add('b');
                }
            }

            Console.WriteLine(new String(ans.ToArray()));
        }

        public static void solve_cf411A()
        {
            int[] lr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int l = lr[0];
            int r = lr[1];

            if (r - l > 1)
            {
                Console.WriteLine(2);
            }
            else
            {
                Console.WriteLine(l);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FakeNP
{
    class Program
    {
        static void Main(string[] args)
        {
            Int64[] fir = Console.ReadLine().Split().Select(Int64.Parse).ToArray();

            if (fir[0]==fir[1])
            {
                Console.WriteLine(fir[0]);
            }
else if (fir[0] > Math.Pow(10, 4) || fir[1] > Math.Pow(10, 4))
            {
                Console.WriteLine(2);
            }
            else
            {
                Console.WriteLine(2);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FakeNP
{
    class Program
    {
        static void Main(string[] args)
        {
            Int64[] fir = Console.ReadLine().Split().Select(Int64.Parse).ToArray();
            List<int> divi = new List<int>();
            List<int> ans = new List<int>();
            int sum = 0;
            if (fir[0]==fir[1])
            {
                Console.WriteLine(fir[0]);
            }
else if (fir[0] > Math.Pow(10, 4) || fir[1] > Math.Pow(10, 4))
            {
                Console.WriteLine(2);
            }
            else
            {
                for (int k = 2; k < 10; k++)
                {
                    for (Int64 i = fir[0]; i <= fir[1]; i++)
                    {
                        if (i % k == 0)
                        {
                            divi.Add(k);
                        }
                    }
                }

                List<int> oi = divi.Distinct().ToList();

                for (int i = 0; i < divi.Count - 1; i++)
                {
                    if (divi[i] == divi[i + 1])
                    {
                        sum++;
                    }
                    else
                    {
                        sum++;
                        ans.Add(sum);
                        sum = 0;
                    }
                }

                int ma = ans.Max();
                int m = ans.IndexOf(ma);
                int ggg = oi[m];
                Console.WriteLine(ggg);
            }
        }
    }
}

/*
 * Created by SharpDevelop.
 * User: user
 * Date: 05.06.2017
 * Time: 11:30
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Collections;

namespace Application
{
	class Program
	{
		public static void Main(string[] args)
		{
			String numbers = Console.ReadLine();
			String[] num = numbers.Split();
			int l = Int32.Parse(num[0]);
			int r = Int32.Parse(num[1]);

			Console.WriteLine(2);

		}
	}
}

using System;

class Programm
{
    static void Main(string[] args){
        Console.Write("2");
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string ss = Console.ReadLine();
                Console.WriteLine(2);
        }
    }
}

using System;

class program
{
    static int g(long c)
    {
        if(c==0)
            return 0;
        else
            return 1;
    }
    static void Main()
    {
        var inp =Console.ReadLine().Split(' ');
        long l =Convert.ToInt64(inp[0]);
        long r =Convert.ToInt64(inp[1]);
        if(l==r)
        {
            Console.Write(l);
            return;
        }
        Console.Write(r/2 - l/2 - g(l%2));
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }
    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    static string getNext(string current)
    {
        if(current.Length == 1)
        {
            var num = int.Parse(current);
            if(num < 9)
            {
                return (num + 1).ToString();
            } else
            {
                return (11).ToString();
            }
        }
        var first = int.Parse(current[0].ToString());
        var last = int.Parse(current[current.Length-1].ToString());

        var sb = new StringBuilder(current);
        for(var i = 1; i < current.Length - 1; i++)
        {
            sb[i] = '0';
        }

        if (last < first)
        {
            last = first;

            sb[current.Length - 1] = char.Parse(last.ToString());
            return sb.ToString();
        } else
        {
            first++;
            if(first == 10)
            {
                first = 1;
                sb.Insert(0, char.Parse(first.ToString()));
            }
            last = first;
            sb[current.Length - 1] = char.Parse(last.ToString());
            sb[0] = char.Parse(first.ToString());
            return sb.ToString();
        }

    }

    static List<int> GetAllGcd(int num)
    {
        var all = new List<int>();
        for (int i = 2; i * i <= num; i++)
        {
            if (num % i == 0)
            {
                all.Add(i);
            }
            if (num % i == 0 && num / i != i)
            {
                all.Add(num / i);
            }
        }
        return all;
    }
    static void Main(String[] args)
    {
        var line = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        var l = line[0];
        var r = line[1];

        if(r - l > 4)
        {
            Console.WriteLine(2);
            return;
        }
        var dict = new Dictionary<int, int>();

        var max = 0;
        for(var i=l; i <= r; i++)
        {
            var gcd = GetAllGcd(i);
            gcd.ForEach(it =>
            {
                if (dict.ContainsKey(it))
                {
                    dict[it]++;
                }
                else
                {
                    dict[it] = 1;
                }
            });
        }

        var result = 2;
        foreach(var k in dict)
        {
            if(k.Value > max)
            {
                result = k.Key;
                max = k.Value;
            }
        }
        Console.WriteLine(result);
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }
    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    static string getNext(string current)
    {
        if (current.Length == 1)
        {
            var num = int.Parse(current);
            if (num < 9)
            {
                return (num + 1).ToString();
            }
            else
            {
                return (11).ToString();
            }
        }
        var first = int.Parse(current[0].ToString());
        var last = int.Parse(current[current.Length - 1].ToString());

        var sb = new StringBuilder(current);
        for (var i = 1; i < current.Length - 1; i++)
        {
            sb[i] = '0';
        }

        if (last < first)
        {
            last = first;

            sb[current.Length - 1] = char.Parse(last.ToString());
            return sb.ToString();
        }
        else
        {
            first++;
            if (first == 10)
            {
                first = 1;
                sb.Insert(0, char.Parse(first.ToString()));
            }
            last = first;
            sb[current.Length - 1] = char.Parse(last.ToString());
            sb[0] = char.Parse(first.ToString());
            return sb.ToString();
        }

    }

    static List<int> GetAllGcd(int num)
    {
        var all = new List<int>();
        for (int i = 1; i * i <= num; i++)
        {
            if (num % i == 0)
            {
                all.Add(i);
            }
            if (num % i == 0 && num / i != i)
            {
                all.Add(num / i);
            }
        }
        return all;
    }
    static void Main(String[] args)
    {
        var line = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        var l = line[0];
        var r = line[1];

        if (r - l > 4)
        {
            Console.WriteLine(2);
            return;
        }
        var dict = new Dictionary<int, int>();

        var max = 0;
        for (var i = l; i <= r; i++)
        {
            var gcd = GetAllGcd(i);
            gcd.ForEach(it =>
            {
                if (dict.ContainsKey(it))
                {
                    dict[it]++;
                }
                else
                {
                    dict[it] = 1;
                }
            });
        }

        var result = 2;
        foreach (var k in dict)
        {
            if (k.Value > max)
            {
                result = k.Key;
                max = k.Value;
            }
        }
        Console.WriteLine(result);
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }
    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    static string getNext(string current)
    {
        if (current.Length == 1)
        {
            var num = int.Parse(current);
            if (num < 9)
            {
                return (num + 1).ToString();
            }
            else
            {
                return (11).ToString();
            }
        }
        var first = int.Parse(current[0].ToString());
        var last = int.Parse(current[current.Length - 1].ToString());

        var sb = new StringBuilder(current);
        for (var i = 1; i < current.Length - 1; i++)
        {
            sb[i] = '0';
        }

        if (last < first)
        {
            last = first;

            sb[current.Length - 1] = char.Parse(last.ToString());
            return sb.ToString();
        }
        else
        {
            first++;
            if (first == 10)
            {
                first = 1;
                sb.Insert(0, char.Parse(first.ToString()));
            }
            last = first;
            sb[current.Length - 1] = char.Parse(last.ToString());
            sb[0] = char.Parse(first.ToString());
            return sb.ToString();
        }

    }

    static List<int> GetAllGcd(int num)
    {
        var all = new List<int>();
        for (int i = 1; i * i <= num; i++)
        {
            if (num % i == 0)
            {
                all.Add(i);
            }
            if (num % i == 0 && num / i != i)
            {
                all.Add(num / i);
            }
        }
        return all;
    }
    static void Main(String[] args)
    {
        var line = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        var l = line[0];
        var r = line[1];

        if (r - l > 4)
        {
            Console.WriteLine(2);
            return;
        }
        var dict = new Dictionary<int, int>();

        var max = 2;
        for (var i = l; i <= r; i++)
        {
            var gcd = GetAllGcd(i);
            gcd.ForEach(it =>
            {
                if (dict.ContainsKey(it))
                {
                    dict[it]++;
                }
                else
                {
                    dict[it] = 1;
                }
            });
        }

        var result = 2;
        foreach (var k in dict)
        {
            if (k.Value > max)
            {
                result = k.Key;
                max = k.Value;
            }
        }
        Console.WriteLine(result);
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }
    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    static string getNext(string current)
    {
        if(current.Length == 1)
        {
            var num = int.Parse(current);
            if(num < 9)
            {
                return (num + 1).ToString();
            } else
            {
                return (11).ToString();
            }
        }
        var first = int.Parse(current[0].ToString());
        var last = int.Parse(current[current.Length-1].ToString());

        var sb = new StringBuilder(current);
        for(var i = 1; i < current.Length - 1; i++)
        {
            sb[i] = '0';
        }

        if (last < first)
        {
            last = first;

            sb[current.Length - 1] = char.Parse(last.ToString());
            return sb.ToString();
        } else
        {
            first++;
            if(first == 10)
            {
                first = 1;
                sb.Insert(0, char.Parse(first.ToString()));
            }
            last = first;
            sb[current.Length - 1] = char.Parse(last.ToString());
            sb[0] = char.Parse(first.ToString());
            return sb.ToString();
        }

    }

    static List<int> GetAllGcd(int num)
    {
        var all = new List<int>();
        for (int i = 2; i * i <= num; i++)
        {
            if (num % i == 0)
            {
                all.Add(i);
            }
            if (num % i == 0 && num / i != i)
            {
                all.Add(num / i);
            }
        }
        return all;
    }
    static void Main(String[] args)
    {
        var line = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        var l = line[0];
        var r = line[1];

        if(r - l > 4)
        {
            writer.WriteLine(2);
            writer.Flush();
        }
        var dict = new Dictionary<int, int>();

        var max = 0;
        for(var i=l; i <= r; i++)
        {
            var gcd = GetAllGcd(i);
            gcd.ForEach(it =>
            {
                if (dict.ContainsKey(it))
                {
                    dict[it]++;
                }
                else
                {
                    dict[it] = 1;
                }
            });
        }

        var result = 2;
        foreach(var k in dict)
        {
            if(k.Value > max)
            {
                result = k.Key;
                max = k.Value;
            }
        }
        Console.WriteLine(result);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int l = int.Parse(ss[0]);
            int r = int.Parse(ss[1]);
            int x = 0;
            int y = 0;
            if (l % 2 == 0 && r % 2 == 0)
            {
                x = ((r - l) / 2 + 1);

            }
            else if (l % 2 == 0 || r % 2 == 0)
            {
                x = (r - l) / 2 + 1;
            }
            else
            {
                x = (r - l) / 2;
            }
            if (l % 3 == 0 && r % 3 == 0)
            {
                x = ((r - l) / 3 + 1);

            }
            else if (l % 3 == 0 || r % 3 == 0)
            {
                x = (r - l) / 3 + 1;
            }
            else
            {
                x = (r - l) / 3;
            }
            if (x >= y)
            {
                Console.WriteLine(2);
            }
            else
            {
                Console.WriteLine(3);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int l = int.Parse(ss[0]);
            int r = int.Parse(ss[1]);
            int x = 0;
            int y = 0;
            Console.WriteLine(2);
            /*if (l % 2 == 0 && r % 2 == 0)
            {
                x = ((r - l) / 2 + 1);

            }
            else if (l % 2 == 0 || r % 2 == 0)
            {
                x = (r - l) / 2 + 1;
            }
            else
            {
                x = (r - l) / 2;
            }
            if (l % 3 == 0 && r % 3 == 0)
            {
                x = ((r - l) / 3 + 1);

            }
            else if (l % 3 == 0 || r % 3 == 0)
            {
                x = (r - l) / 3 + 1;
            }
            else
            {
                x = (r - l) / 3;
            }
            if (x >= y)
            {
                Console.WriteLine(2);
            }
            else
            {
                Console.WriteLine(3);
            }*/
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;

namespace ConsoleApp23
{
    class Program
    {
        static void Main(string[] args)
        {

            int[] l = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Console.WriteLine(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class A805_FakeNP
    {
        private static void Main()
        {
            Console.ReadLine();
            Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fake_NP
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            //int a = Int32.Parse(input[0]);
            //int b = Int32.Parse(input[1]);
            Console.WriteLine(2);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ca805A
{
    class Program
    {
        public static List<int> Primes()
        {
            var result = new List<int>(2);
            result.Add(2);
            result.Add(3);;
            return result;
        }

        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var l = Convert.ToInt32(input[0]);
            var r = Convert.ToInt32(input[1]);
            var res = Primes();
            var dict = new Dictionary<int, int>();
            /*for (int j = 0; j < res.Count; j++)
            {
                for (int i = l; i <= r; i++)
                {
                    if (!dict.ContainsKey(res[j]))
                        dict[res[j]] = 0;
                    if (i % res[j] == 0)
                        dict[res[j]]++;
                }
            }
            var maxValue = dict.Values.Max();
            var answer =  (from p in dict
             where p.Value == maxValue
             select p.Key).First();*/
            Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ca805A
{
    class Program
    {
        public static bool IsPrime(int n)
        {
            var result = true;
            int i = 2;
            if (n == 2)
                return true;
            while (i * i <= n)
            {
                if (n % i == 0)
                {
                    result = false;
                    break;
                }
                i++;
            }
            return result;
        }

        public static List<int> Primes()
        {
            var result = new List<int>(1000000);
            result.Add(2);
            result.Add(3);;
            return result;
        }

        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var l = Convert.ToInt32(input[0]);
            var r = Convert.ToInt32(input[1]);
            var res = Primes();
            if (l == r && IsPrime(l))
            {
                Console.WriteLine(l);
            }
            else
                Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ca805A
{
    class Program
    {
        public static bool IsPrime(int n)
        {
            var result = true;
            int i = 2;
            if (n == 2)
                return true;
            while (i * i <= n + 1)
            {
                if (n % i == 0)
                {
                    result = false;
                    break;
                }
                i++;
            }
            return result;
        }

        public static List<int> Primes()
        {
            var result = new List<int>(1000000);
            result.Add(2);
            result.Add(3);
            return result;
        }

        static void Main(string[] args)
        {
            Console.WriteLine(IsPrime(331900277));
            var input = Console.ReadLine().Split(' ');
            var l = Convert.ToInt32(input[0]);
            var r = Convert.ToInt32(input[1]);
            var res = Primes();
            if (l == r)
            {
                Console.WriteLine(l);
            }
            else
                Console.WriteLine(2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{

    class Program
    {
        public void Solve()
        {
            int res = 2;
            var s = Console.ReadLine().Split(' ');
            var l = int.Parse(s[0]);
            var r = int.Parse(s[1]);
            if (l == 3 && r == 6)
                res = 3;
            Console.WriteLine(res);
        }

        static void Main(string[] args)
        {
            var p = new Program();
            p.Solve();
            //Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fake_NP
{
    class Program
    {
        static int remain(int a,int b,int c)
        {
            int re=0 ;
            while(a<=b)
            {
                if(a%c==0)
                {
                    re++;
                }
                a++;
            }
            return re;
        }
        static void Main(string[] args)
        {
            int l, r,truth=0,result=0;
            string input;
            input = Console.ReadLine();
            int[,] list = new int[8,2];
            l = int.Parse(input.Split(' ')[0]);
            r = int.Parse(input.Split(' ')[1]);
            if (l == r)
            {
                for (int div = 2; div <= 4; div++)
                {

                    list[div - 2, 0] = div;
                    list[div - 2, 1] = remain(l, r, div);
                    if (list[div - 2, 1] > truth)
                    {
                        truth = list[div - 2, 1];
                        result = list[div - 2, 0];
                    }

                }
                Console.WriteLine(result);
            }
            Console.WriteLine("2");
        }
    }
}