1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
def czy(t):
	for i in range(1,len(t)):
		if t[i]>t[i-1]:
			return False
	return True

n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
a = [max(a[:n-k+1])]+a[n-k+1:]

if not czy(a):
	print("TAK")
	print(" ".join([str(i) for i in range(n-k+1,n+1)]))
else:
	print("NIE")