시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB48191642.105%

문제

Using a pocket calculator, enter a positive integer K and press "+". The calculator still shows the number K. Then again enter the number K. After pressing the "+" key for the second time, the result is: K + K. The game goal is to obtain a number, consisting of equal digits only, by repeating this operation many (possibly 0) times. Write a program calcgame that determines whether it is possible to reach the goal.

If possible, what is the first number, which consists of equal digits only and is obtained by multiple summing?

입력

On the standard input, a positive integer K is given. (1 ≤ K ≤ 999)

출력

If reaching the goal is impossible, print "Impossible". If possible, a line of the standard output should contain two integers separated by a space: the first is the digit itself and the second is the amount of digits of the obtained number.

예제 입력 1

37

예제 출력 1

1 3

예제 입력 2

25

예제 출력 2

Impossible

예제 입력 3

999

예제 출력 3

9 3

출처

Olympiad > International Autumn Tournament in Informatics > 2011 > Group B (Juniors) 2번

  • 문제의 오타를 찾은 사람: shiftpsh