Mock CCC '18 Contest 1 J1 - A String Problem

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 1G

Problem type

Given a positive integer NN with no zeroes in its base-10 representation, compute the smallest positive integer greater than NN with no zeroes in its base-10 representation.

Constraints

1 \le N \le 999\,9991 \le N \le 999\,999

NN will not contain the digit zero in its base-10 representation.

Input Specification

The input consists of a single line containing the integer NN.

Output Specification

Print, on a single line, the smallest positive integer greater than NN with no zeroes in its base-10 representation.

Sample Input 1

99

Sample Output 1

111

Sample Input 2

1234

Sample Output 2

1235

Comments

There are no comments at the moment.