SP8886 GNUM - Guess number!

Description

There was an application "Guess number!" in one of the popular social network recently. On each of the levels of this offered game it is necessary to define the secret number with some information provided. In particular, one of the most difficult levels consists in guessing the rational number _x_ (0 < _x_ < 1). It is known, that the result of multiplication of this number by natural number _k_ is exactly one alteration: the _i_-th and _j_-th digits after a decimal point are exchanged by each other. As the number in front of decimal point isn't changed, the inequality 0 < _kx_ < 1 is executed. Initially the numbers after a decimal point can be infinite. Your problem consists in writing the program which will define value _x_ on numbers _i_, _j_, _k_.

Input Format

The first input line contains in one integer _t_ (about 1000). Each of the following _t_ lines contains three numbers: _i_, _j_, _k_ (1 ≤ _i_ < _j_ ≤ 1000; 2 ≤ _k_ ≤ 10 $ ^{9} $ ).

Output Format

If the required number exists, output consists in two integers — numerator and denominator of a non-reducible fraction setting required number. Otherwise output is "NO SOLUTION".