Divide and Conquer

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given two integers $M$ and $N$ with $1 \le M \le N \le 5000$. Determine two integers $X$ and $Y$ that satisfy all of the following:

  • A. $M \le X \le N$;
  • B. $Y$ is the number of divisors of $X$;
  • C. $Y$ is as large as possible;
  • D. $X$ is as large as possible.

In other words, among all integers in the range $[M, N]$, choose the one with the greatest number of divisors as $X$; if several integers tie for the greatest number of divisors, choose the largest such integer. $Y$ is that number of divisors.

Input

The input consists of several test cases. Each test case is a single line containing two integers $M$ and $N$ ($1 \le M \le N \le 5000$) separated by a space. A line with $M = N = 0$ marks the end of the input and should not be processed.

The input is read from standard input.

Output

For each test case, print a single line containing the two integers $X$ and $Y$ separated by a space.

The output is written to standard output.