Keyboard Queries
문제
Katrín and her friends are university students, and they go to a seminar every week. At the start of each seminar, the professor divides the students into groups randomly. Katrín and her friends dislike random groups, they want to form a group together so they can chat with each other and not get to know the other students. The professor has a secret string consisting of characters on their computer. This string acts as a seed for the random group generation. When generating groups, a program manager is ran with a substring of as input. But sometimes, the professor mistypes and writes manacher instead. This will indicate that the substring is a palindrome. Maybe Katrín can use this information to predict what the group division will look like?
There is a secret string with characters in an unknown alphabet. You are given queries of two types.
1 l r: This means that the substring of at indices through is a palindrome.2 a b x y: This means that you should determine whether the substring at indices though is equal to the substring at indices through , given the information in the previous queries.
입력
The first line of input contains two integers and (, ), the number of characters in the unknown string and the number of queries.
The following lines each start with a or a indicating the type of query. For queries of type , two integers and follow (), meaning that the corresponding substring of is a palindrome. For queries of type , four integers follow (, ), meaning that you should determine whether those two substrings are equal or not.
출력
For each query of the second kind print "Equal" if the substrings must be equal, "Not equal" if the substrings can't be equal, and "Unknown" if either possibility could be true given the information thus far.
예제
예제 1
6 8 1 1 6 2 1 1 6 6 2 1 2 5 6 2 1 3 5 6 1 1 3 2 1 3 4 6 2 4 4 6 6 2 2 3 4 5
Equal Unknown Not equal Equal Equal Unknown