시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
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(1 ≤ n ≤ 1000000)이 주어지며 N=0일 경우 프로그램은 종료된다.

출력

각 테스트 케이스로 입력받은 N번쨰에 해당하는 수를 출력한다.

예제 입력 1

25
10000
0

예제 출력 1

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