Baby Sukhwan Tururu Turu
Time limit1sMemory limit512 MB
Find the N-th word of a repeating song whose tururu runs grow by one extra ru each repetition, with long runs printed in a compressed form.
- Level
Easy3 of 10
- Topics
- Implementation, Math, Simulation, String
- Solved
- No attempts yet
Problem
Sukhwan drank coffee during the day today and cannot fall asleep. Finding himself too bored under the covers, he decides to sing the song "Baby Sukhwan" until he falls asleep. Unlike seokhwan, one of the judges of UCPC 2018, he writes his own name as sukhwan. When the song ends, he starts over from the beginning. The song "Baby Sukhwan" goes as follows.
baby sukhwan tururu turu
very cute tururu turu
in bed tururu turu
baby sukhwan
But singing the song the same way every time is boring, so each time the song ends, Sukhwan adds one more "ru" to "tururu" and to "turu" and sings as follows.
baby sukhwan tururu turu
very cute tururu turu
in bed tururu turu
baby sukhwan
baby sukhwan turururu tururu
very cute turururu tururu
in bed turururu tururu
baby sukhwan
baby sukhwan tururururu turururu
very cute tururururu turururu
in bed tururururu turururu
baby sukhwan
…
What is the N-th word of the song Sukhwan sings?
Input
The first line gives a natural number N (1 ≤ N ≤ 1,000,000).
Output
On the first line, print the word Sukhwan will sing N-th. Here a word means a run of lowercase letters separated by spaces in the lyrics. However, when the word to print is "tururu...ru", if "ru" repeats k times (k ≥ 5), print it as "tu+ru*k".