1514 - [acwing]下一个

通过次数

13

提交次数

22

Time Limit : 1 秒
Memory Limit : 128 MB

给定一个整数 x,请你找到严格大于 x 且各位数字均不相同的最小整数 y。

Input

一个整数 x。

Output

一个整数 y。

保证一定有解。

Examples

Input

1987

Output

2013

Input

2013

Output

2014

Hint

所有测试点满足 1000≤x≤9000。