The Hunminjeongeum Haerye manuscript published by King Sejong was designated National Treasure No. 70 in 1962. To celebrate the excellence of Hangul and commemorate the creation and proclamation of Hunminjeongeum, October 9 of every year is designated as the national holiday Hangul Day.
To celebrate Hangul Day, write numbers in Hangul. Numbers from 1 through 1052−1 are written using the usual Korean notation for numbers. Since that notation can vary by context, this problem uses the following grammar as the unified notation.
For instance, 1234567890998808777006660055400433000002100000001962 is written as "일천이백삼십사극오천육백칠십팔재구천구십구정팔천팔백팔간칠천칠백칠십구육백육십육양오십오자사천사해삼천삼백경이조일천억일천구백육십이", and 2147483647 is written as "이십일억사천칠백사십팔만삼천육백사십칠".
In our world, every Hangul consonant and vowel exists, so the rules above can be used as written. Now imagine a parallel world where some consonants and vowels do not exist. In a world without ㅇ, if the Hangul notation of a number in our world contains ㅇ, that number is treated as nonexistent. Therefore $1$(일) and $2$(이) do not exist, and $3$(삼) is the first positive integer.
Our world also has larger-number units such as 항하사, 아승기, 나유타, 불가사의, and 무량대수, but they are not used in this problem. If a number is too large to be written by the grammar above, that number is also treated as nonexistent.
Output the N-th positive integer of the parallel world, written as an Arabic numeral in our world.