Palindrome Cheokhwabi
InterviewTime limit1sMemory limit1024 MB
Given N, print any length-N lowercase string that is both a palindrome and has identical front and back halves.
- Level
Easy3 of 10
- Topics
- Implementation, String, Math, Greedy
- Solved
- No attempts yet
Statement
Heungseon hates palindromes. One day, after conquering the Earth, Heungseon erected the Palindrome Cheokhwabi and wiped out every palindrome on the planet. He then built the Sumisanggwan Purity Monument and spread sumisanggwan far and wide.
The definitions of palindrome and sumisanggwan are as follows.
- Palindrome: (the same front and back, palindrome~) a string that reads the same when reversed, such as "u", "xyx", or "krrk".
- Sumisanggwan: (the same front and back, sumisanggwan~) a string whose front half equals its back half, such as "z", "pqpq", or "astoast". Precisely, for a string of length , it means the prefix and suffix of length are identical.
Minsu wanted to preserve the long history of palindromes, but the Palindrome Cheokhwabi planted everywhere kept him from realizing that dream. Even so, there is always a way out, even when the sky falls! Minsu discovered a string of length that is both sumisanggwan and a palindrome! This did not violate Heungseon's Palindrome Cheokhwabi, so Minsu wrote this fact in a corner of his notebook to pass the long history of palindromes down to later generations.
In the future, his descendants found Minsu's notebook, but too much time had passed. Because of stains and dust, much of the notebook could not be read. All they could learn was the fact that Minsu had discovered a string of length that is both sumisanggwan and a palindrome.
Sicheol, a descendant of Minsu, believed the notebook to be true, and he is researching all night in the engineering building to find a string of length that is both sumisanggwan and a palindrome.
What was it that Minsu found?
Input
The input is given as follows.
Output
Output a string of length made of lowercase English letters that is both sumisanggwan and a palindrome.
Such a string always exists, and if there are several, output any one of them.
Constraints
- All numbers given in the input are integers.
Hint
It is said that Minsu wrote only the fact of the discovery, because the notebook had no room to spare.