1792: Find Out an “E”

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:3 解决:0

题目描述

As we all know, letter "E" is the most frequent letter used in English. When spelling out integers, it is interesting to see which ones do NOT use the letter "E". For example, 66 (sixty six) doesn‘t. However, 1020 (one thousand twenty) does. It turns out that 66 is the 19th positive integer that does not use an "E" when spelled out and 32,000 is the 100th such number. Your task is to find out the n-th positive integer that does not use an "E".

输入

The input file has multiple lines. Each line is one positive integer n (less than 231). A 0 indicates end-of-input. (There will be NO commas in the input file.)

输出

For each input n, you will print, with appropriate commas, the n-th positive integer whose spelling does not use an "E". All answers are less than 1028.

样例输入 复制

1
2
3
19
20
0

样例输出 复制

2
4
6
66
2,000

提示

You should print your answers like 2,000 or 12,111,222,000 !