Fair Division
Fortunately, pirates in the 21st century can use a computer to avoid this lengthy process and constant nitpicking when the fraction $f$ does not exactly divide the loot at some step. You have been captured by the pirates and asked to come up with a suitable fraction $f$. As an incentive, Cap’n Red has promised to leave you alive if you succeed.
The fraction $f$ needs to be a rational number strictly between $0$ and $1$. It is not necessary that $f$ exactly divides the loot remaining at any step of the round-robin process described above. However, the total loot that would be assigned to each pirate by carrying out this process infinitely needs to be an integer.
Input
The input contains one line with two integers $n$ and $m$, where $n$ ($6 \leq n \leq 10^6$) is the number of pirates including Cap’n Red and $m$ ($1 \leq m \leq 10^{18}$) is the total value of their loot.
Output
Output one line with two positive integers $p$ and $q$, where $f = \frac{p}{q}$ as specified above. If there are multiple suitable fractions, choose one with the smallest $q$. Among multiple suitable fractions with the same smallest $q$ choose the one with the smallest $p$. If there is no suitable fraction, output impossible instead and hope for mercy.
| Sample Input 1 | Sample Output 1 |
|---|---|
8 51000 |
1 2 |
| Sample Input 2 | Sample Output 2 |
|---|---|
6 91000 |
2 3 |
| Sample Input 3 | Sample Output 3 |
|---|---|
10 1000000000000000000 |
impossible |