B. String
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Snow has a string, and now he wants to use magic to shorten this string. Each time he casts a spell, he can eliminate three adjacent identical characters. But Snow finds it too time-consuming to cast the spell repeatedly, so he hopes you can help him calculate what the shortest form of the string will be after using magic any number of times.

Input

Input a string, ensuring that it only contains lowercase letters, and the length of the string does not exceed $$$10^6$$$.

Output

Output a string representing the shortest string after casting magic.If the entire string is eliminated, the output should be "NAN".

Example
Input
bcabaaabbccabcc
Output
bcaccabcc