시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB110695964.835%

문제

Yosef is a peculiar fellow. He introduced the idea to study a string by splitting it into two, and he called it Splitology. Why split a string? We do not know. Didn’t we say that Yosef is a weird one?

Yosef is interested in one particular type of string, a palindrome. A palindrome is a string that is the same for both forwards and backwards. Example of palindrome strings are “ada”, “taat”, and “radar”. On the other hand, string such as “taman” is not a palindrome; notice that “taman” becomes “namat” if read backwards and it’s not the same as “taman”.

As the idea of Splitology is still new, Yosef is investigating whether a string can be split into two non-empty strings such that each string is a palindrome.

For example, the string “malamini” can be split into “malam” and “ini” while both of them are palindrome. Another example is “ababab”. It can be split into “aba” and “bab”, and both of them are palindrome. Note that “ababab” can also be split into another pair of palindrome strings, e.g., “ababa” and “b”, or “a” and “babab”.

Gunawan, a friend of Yosef, is also a peculiar one. When he learned about Splitology, he asks Yosef whether the string “irvinganteng” can be split into two palindrome strings. The answer is of course no. It can be proven that such a string cannot be split into two palindrome strings.

Given a string S, determine whether it can be split into two non-empty palindrome strings. If the answer is yes, then output two palindrome strings A and B where the concatenation of A and B is S, i.e. S = A + B. If the answer is no, then simply output “NO” without quotes.

입력

Input contains a string S in a line representing the given string. String S contains only lowercase alphabetical characters (a-z) and its length is between 2 and 500, inclusive.

출력

If S cannot be split into two palindrome strings, then output “NO” in a line. Otherwise, output two palindrome strings A and B in a line separated by a single space such that S = A + B. If there is more than one way to split S into two palindrome strings, you only need to output (any) one pair of A and B.

예제 입력 1

malamini


예제 출력 1

malam ini


예제 입력 2

ababab


예제 출력 2

aba bab


Other outputs such as “a babab” (without quotes) or “ababa b” (without quotes) are also accepted.

예제 입력 3

irvinganteng


예제 출력 3

NO


예제 입력 4

adakodok


예제 출력 4

ada kodok


예제 입력 5

mnonm


예제 출력 5

NO


예제 입력 6

se


예제 출력 6

s e