Calling Extraterrestrial Intelligence Again

For each query with m and fraction a/b, find primes p and q with pq <= m and a/b <= p/q <= 1 that maximize the product pq.

Medium5Number theoryMathBrute forceImplementationInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

On the afternoon of Saturday, November 16, 1974, a message from humans to extraterrestrial intelligence was sent through the Arecibo radio telescope in Puerto Rico. The message consisted of 1679 bits and was meant to be read as a rectangular picture of 23 × 73 pixels. Since both 23 and 73 are prime numbers, 23 × 73 is the only possible size of the picture in which each edge is longer than 1 pixel. Of course, there was no guarantee that the receivers would try to read the message as a rectangular picture. Even if they did, they might place the pixels into the rectangle incorrectly. The senders of the Arecibo message were optimistic.

We are planning a similar project. Your task in the project is to find the most suitable width and height of the decoded rectangular picture. "Most suitable" is defined as follows. An integer mm greater than 4 is given. A positive fraction a/ba/b less than or equal to 1 is also given. The area of the picture must not be greater than mm. Both the width and the height of the picture must be prime numbers. The ratio of the width to the height must be neither less than a/ba/b nor greater than 1. You have to maximize the area of the picture under these constraints.

In other words, you receive an integer mm and a fraction a/ba/b with m>4m > 4 and 0<a/b10 < a/b \le 1. Find the pair of prime numbers pp, qq such that pqmpq \le m and a/bp/q1a/b \le p/q \le 1, and the product pqpq is the maximum among all such pairs. Report pp and qq as the "most suitable" width and height of the picture.

Input

The input is a sequence of at most 2000 triplets of positive integers. Each line contains one triplet, with a single space between the integers. The sequence is followed by a line with the triplet 0 0 0, which marks the end of the input and is not to be processed.

The three integers of a triplet are the integer mm, the numerator aa, and the denominator bb described above, in this order. It holds that 4<m<1000004 < m < 100000 and 1ab10001 \le a \le b \le 1000.

Output

Print one line for each input triplet, in the same order. The ii-th output line answers the ii-th input triplet and contains the width pp and the height qq described above, in this order, separated by a single space. Print no other characters.