Alien Integers

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Exploratory robots are essential to expanding our understanding of the moon, Mars, and other celestial bodies. When there are two or more robots in the same vicinity, they need to be marked by humanly readable integers for purposes of visual tracking. To reduce the possibility of error in visual recognition of the robots in dark and dusty environments, numbers are chosen so that they have no digits in common. More formally, two non-negative integers are alien to each other if there is no digit which occurs in both of their decimal representations. For example, 11,22911\\,229 and 67,84067\\,840 are alien to each other, while 2,0222\\,022 and 427427 are not. No integer is alien to 1,234,567,8901\\,234\\,567\\,890.

The numbers on robots in the same area should also be close to each other numerically (for instance, to simplify processing of the marks by the software, to make them easy to remember, to distinguish them from other groups of robots marked in similar manner, . . . ).

The Institute for Computerized Planetary Circumambulation needs a program to identify the nearest number that is alien to a given number. Can you help?

입력

The input consists of an integer NN (1N10151 ≤ N ≤ 10^{15}) given on a single line.

출력

When there is one non-negative alien integer YY closest to the input number NN, output the value of YY. When there are two such integers that are equally close to the input number NN, output both of them in ascending order, on a single line. When there is no integer alien to the input number NN, output Impossible.