You are given two words u and v built only from the letters a and b. Your goal is to turn the word u into the word v using only the following swap operation:
ab and one occurrence of the substring ba whose positions do not overlap (they are disjoint), then swap the two fragments. After the swap, the place that held ab holds ba, and the place that held ba holds ab.Decide whether, by performing a finite number of such operations, u can be turned into v.
The first line contains an integer n (2≤n≤1000000), the length of the words.
Each of the next two lines contains a string of n characters, each a or b. The first line is the word u and the second line is the word v. You may assume the two words are different.
Print TAK (yes) on a single line if u can be turned into v using only the swap operation, and NIE (no) otherwise.