Game with a Calculator
In the calculator, a natural number K is entered, and the "+" key is pressed. The calculator continues to display K. The objective is to display a number on the screen that consists entirely of identical digits. To achieve this, you can only perform one action: pressing the "=" key (possibly 0 times). After the first press, the result becomes K + K, and with each subsequent press, the result increases by K. You need to determine whether the goal can be achieved, and if so, identify the first number consisting of identical digits that will appear. Assume the calculator can display an unlimited number of digits, and the battery life is infinite.
Input
The first line contains a single number - K (1 ≤ K ≤ 999).
Output
If achieving the goal is impossible, output "Impossible". If it is possible, output two numbers separated by a space: the digit that makes up the desired number, and the number of digits in that number.