시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 72 26 24 47.059%

문제

한신이는 어릴 때부터 수에 대한 관심이 남달랐으나 이상하게도 같은 숫자를 두 번 이상 쓰는 것을 굉장히 싫어했다.

그래서 한신이에게 첫 번째 수부터 25번째까지의 수를 적어 보라고 하면

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, . . .

과 같이 적어 내었다.

n번째 반복 숫자 없는 수를 만들어 보자!

입력

입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스에는 정수 n(1 ≤ n ≤ 1,000,000)이 주어진다. n = 0인 경우 프로그램을 종료한다.

출력

각 테스트 케이스마다 n번째 반복 숫자 없는 수를 출력한다.

예제 입력 1

25
10000
0

예제 출력 1

27
26057
W3sicHJvYmxlbV9pZCI6Ijc2OTYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMThcdWJjZjVcdWQ1NThcdWM5YzAgXHVjNTRhXHViMjk0IFx1YzIxOCIsImRlc2NyaXB0aW9uIjoiPHA+XHVkNTVjXHVjMmUwXHVjNzc0XHViMjk0IFx1YzViNFx1YjliNCBcdWI1NGNcdWJkODBcdWQxMzAgXHVjMjE4XHVjNWQwIFx1YjMwMFx1ZDU1YyBcdWFkMDBcdWMyZWNcdWM3NzQgXHViMGE4XHViMmVjXHViNzkwXHVjNzNjXHViMDk4IFx1Yzc3NFx1YzBjMVx1ZDU1OFx1YWM4Y1x1YjNjNCBcdWFjMTlcdWM3NDAgXHVjMjJiXHVjNzkwXHViOTdjIFx1YjQ1MCBcdWJjODggXHVjNzc0XHVjMGMxIFx1YzRmMFx1YjI5NCBcdWFjODNcdWM3NDQgXHVhZDQ5XHVjN2E1XHVkNzg4IFx1YzJlYlx1YzViNFx1ZDU4OFx1YjJlNC48XC9wPlxyXG5cclxuPHA+XHVhZGY4XHViNzk4XHVjMTFjIFx1ZDU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