시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB126464636.508%

문제

Great wizard gave Alice and Bob a cycle string of length 2 · n, which has no repeated substrings of length n. In a cycle string, character si+1 comes after si. Also, s1 comes after s2n.

Unfortunately, evil gin shuffled all the symbols of the string. Help Alice and Bob restore the original string so that the above condition is satisfied.

입력

The first line contains one string s of length 2·n (2 ≤ 2·n ≤ 1 000 000) which consists only of the lowercase Latin letters.

출력

Print “NO” (without quotes) to the first line if it is impossible to restore the string so that the condition is satisfied. Otherwise, in the first line print “YES” (without quotes).

In the second line print one string — the restored string.

If there are multiple answers, print any.

예제 입력 1

cbbabcacbb

예제 출력 1

YES
abbabcbccb

예제 입력 2

aa

예제 출력 2

NO

예제 입력 3

afedbc

예제 출력 3

YES
afedbc

힌트

In the first example, substrings of the restored string are: “abbab”, “bbabc”, “babcb”, “abcbc”, “bcbcc”, “cbccb”, “bccba”, “ccbab”, “cbabb”, “babba”.

Note that the first example does not contain repetitions, however it can be rewritten as another cycle with no repetitions. Thus, the solution is not unique — the given example is also a correct solution.

In the second example, it is impossible to restore the string so that no repetition exists.

In the third example, there is no need to change anything.