Author:  A. Klenin  Time limit:  1 sec  
Input file:  input.txt  Memory limit:  64 Mb  
Output file:  output.txt 
Let us define that a positive integer A is simpler than a positive integer B if the decimal representation of A requires less different digits than the decimal representation of B.
For example, number 55 is simpler than 12 which in turn is simpler than 123.
Your program will be given a number N and must find the largest integer X such that X < N and X is simpler than N.
1 ≤ N ≤ 2^{31} − 1
No.  Input file (input.txt ) 
Output file (output.txt ) 

1 


2 

