1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <cstdio>
#include <vector>
using namespace std;


int main() {
  int n;
	scanf("%d",&n);
	char s[301013];
	vector<int> t(52);
	for (int z = -1; z <= 1; z+=2) {
		scanf("%s", s);
		for (int i = 0; i < n; i++) {
		  t[(i%2) * 26 + s[i]-'a'] += z;
		}
	}
	puts((t == vector<int>(52)) ? "TAK" : "NIE");
	return 0;
}