405313: GYM101879 J Meme Wars

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Meme Warstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Altercations between Brazil and Portugal go a long way back. The most recent such skirmish happened in 2016 when these two countries had a "meme war". The journalist Fiorentina "sagacious" Azzellini is studying this event in her work of describing ways in which social networks have changed how people interact.

Brazil flooded the internet with a huge amount of memes, and won the contest in three days. Fiorentina, while investigating how such a huge amount of images could be created, found that some of them could be constructed very simply. The meme was made of an image that had the national flags of Brazil and Portugal, and one word. The word $$$S(x)$$$ was created from a letter $$$x$$$ and has the following composition:

$$$S(x) =$$$ 'a', if $$$x = $$$'a'. Otherwise, $$$S(x) = S(p(x)) \cdot x \cdot S(p(x))$$$,

where $$$p(x)$$$ is the letter that precedes $$$x$$$ in the alphabet and $$$A \cdot B$$$ denotes the concatenation of words $$$A$$$ and $$$B$$$. Fiorentina started playing with distinct letters and wrote in her notebook

$$$S($$$'b'$$$)$$$ = 'aba',

$$$S($$$'c'$$$)$$$ = 'abacaba',

...

Sagacious as she is, Fiorentina quickly noticed that the word $$$S($$$'z'$$$)$$$ is huge. Not willing to write it down in her notebook, but still curious about some of the letters in this word, she asked for you to help. She would like to know what the letter in the $$$n$$$th position of the word $$$S($$$'z'$$$)$$$ is.

Input

A single integer $$$n$$$.

Constraints

  • $$$1 \leq n \leq 10^3$$$
Output

A single character, the letter in the $$$n$$$-th position of the word $$$S($$$'z'$$$)$$$.

ExampleInput
1
Output
a

Source/Category

加入题单

上一题 下一题 算法标签: