P15961 [Kattis] Veci
普及-
题目描述

Your program will be given an integer X. Find the smallest number larger than X consisting of the same digits as X.

-----Input-----
The first line of input contains the integer $X$ ($1 \le X \le 999999$). The first digit in $X$ will not be a zero.

-----Output-----
Output the result on a single line. If there is no such number, output $0$.

-----Examples-----
Sample Input 1:
156
Sample Output 1:
165

Sample Input 2:
330
Sample Output 2:
0

输入格式

见题面

输出格式

见题面

样例输入
156
样例输出
165