Problem: Student Dima from Kremland has a matrix a of size n × m filled with non-negative integers.

He wants to select exactly one integer from each row of the matrix so that the bitwise exclusive OR of the selected integers is strictly greater than zero. Help him!

Formally, he wants to choose an integers sequence c_1, c_2, …, c_n (1 ≤ c_j ≤ m) so that the inequality a_{1, c_1} ⊕ a_{2, c_2} ⊕ … ⊕ a_{n, c_n} > 0 holds, where a_{i, j} is the matrix element from the i-th row and the j-th column.

Here x ⊕ y denotes the [bitwise XOR operation](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) of integers x and y.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 500) — the number of rows and the number of columns in the matrix a.

Each of the next n lines contains m integers: the j-th integer in the i-th line is the j-th element of the i-th row of the matrix a, i.e. a_{i, j} (0 ≤ a_{i, j} ≤ 1023). 

Output

If there is no way to choose one integer from each row so that their bitwise exclusive OR is strictly greater than zero, print "NIE".

Otherwise print "TAK" in the first line, in the next line print n integers c_1, c_2, … c_n (1 ≤ c_j ≤ m), so that the inequality a_{1, c_1} ⊕ a_{2, c_2} ⊕ … ⊕ a_{n, c_n} > 0 holds. 

If there is more than one possible answer, you may output any.

Examples

Input


3 2
0 0
0 0
0 0


Output


NIE


Input


2 3
7 7 7
7 7 10


Output


TAK
1 3 

Note

In the first example, all the numbers in the matrix are 0, so it is impossible to select one number in each row of the table so that their bitwise exclusive OR is strictly greater than zero.

In the second example, the selected numbers are 7 (the first number in the first line) and 10 (the third number in the second line), 7 ⊕ 10 = 13, 13 is more than 0, so the answer is found.

Solution (in JAVA):

Solution:
//package codeforcesQuestions;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.*;
public class cdf553b
{
	static void merge(int arr[], int l, int m, int r) 
    { 
        int n1 = m - l + 1; 
        int n2 = r - m; 
        int L[] = new int [n1]; 
        int R[] = new int [n2]; 
        for (int i=0; i<n1; ++i) 
            L[i] = arr[l + i]; 
        for (int j=0; j<n2; ++j) 
            R[j] = arr[m + 1+ j]; 
        int i = 0, j = 0; 
        int k = l; 
        while (i < n1 && j < n2) 
        { 
            if (L[i] <= R[j]) 
            { 
                arr[k] = L[i]; 
                i++; 
            } 
            else
            { 
                arr[k] = R[j]; 
                j++; 
            } 
            k++; 
        } 
        while (i < n1) 
        { 
            arr[k] = L[i]; 
            i++; 
            k++; 
        } 
        while (j < n2) 
        { 
            arr[k] = R[j]; 
            j++; 
            k++; 
        } 
    } 
    static void sort(int arr[], int l, int r) 
    { 
        if (l < r) 
        { 
            int m = (l+r)/2; 
            sort(arr, l, m); 
            sort(arr , m+1, r); 
            merge(arr, l, m, r); 
        } 
    } 
    public static int lowerBound(int[] array, int length, int value) 
	{
        int low = 0;
        int high = length;
        while (low < high) 
        {
            final int mid = (low + high) / 2;
            //checks if the value is less than middle element of the array
            if (value <= array[mid]) 
            {
                high = mid;
            } 
            else 
            {
                low = mid + 1;
            }
        }
        return low;
    }
	public static int upperBound(int[] array, int length, int value) 
	{
        int low = 0;
        int high = length;
        while (low < high) {
            final int mid = (low + high) / 2;
            if (value >= array[mid]) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }
        return low;
    }
    static int gcd(int a, int b) 
    { 
      if (b == 0) 
        return a; 
      return gcd(b, a % b);  
    } 
    static long power(long n,long m)
    {
    	if(m==0)
    		return 1;
    	long ans=1;
    	while(m>0)
    	{
    		ans=ans*n;
    		m--;
    	}
    	return ans;
    }
    static long[][] arrSorter(long arr[][])
    {
    	int n=arr.length;
    	for(int i=0;i<n;)
    	{
    		int j=i;
    		ArrayList<Long> arrli=new ArrayList<Long>();
    		while(j<n&&arr[j][0]==arr[i][0])
    		{
    			arrli.add(arr[j][1]);
    			j++;
    		}
    		Collections.sort(arrli);
    		for(int k=i;k<j;k++)
    		{
    			arr[k][1]=arrli.get(k-i);
    		}
    	}
    	return arr;
    }
    static int BinarySearch(int arr[], int x) 
    { 
        int l = 0, r = arr.length - 1; 
        while (l <= r) { 
            int m = l + (r - l) / 2; 
            if (arr[m] == x) 
                return m; 
            if (arr[m] < x) 
                l = m + 1; 
            else
                r = m - 1; 
        } 
        return -1; 
    } 
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int t=1;//Integer.parseInt(br.readLine());
	    for(int i=1;i<=t;i++)
	    {
	    	String s=br.readLine();
	        String str[]=s.split(" ");
	        int n=Integer.parseInt(str[0]);
	        int m=Integer.parseInt(str[1]);
	        int arr[][]=new int[n][m];
	        for(int j=0;j<n;j++)
	        {
	        	s=br.readLine();
	        	String ss[]=s.split(" ");
	        	for(int k=0;k<m;k++)
	        	arr[j][k]=Integer.parseInt(ss[k]);
	        	//arr[j][1]=Integer.parseInt(ss[1]);
	        }
	        int ans=0;
	        for(int j=0;j<n;j++)
	        	ans=ans^arr[j][0];
	        if(ans>0)
	        {
	        	System.out.println("TAK");
	        	for(int j=0;j<n;j++)
	        		System.out.print("1 ");
	        	System.out.println();
	        }
	        else
	        {
	        	int f=-1,j=0;
	        	String anss="";
	        	out:for(j=0;j<n;j++)
	        	{
	        		for(int k=1;k<m;k++)
	        		{
	        			if(arr[j][k]!=arr[j][0])
	        			{
	        				f=j;
	        				anss=anss+(k+1)+" ";
	        				//System.out.println("j is "+j+" "+arr[j][k]+" "+arr[j][0]);
	        				break out;
	        			}
	        		}
	        		anss+="1 ";
	        	}
	        	if(f==-1)
	        		System.out.println("NIE");
	        	else
	        	{
	        		System.out.println("TAK");
	        		System.out.print(anss);
	        		for(int k=j+1;k<n;k++)
	        		System.out.print("1 ");
	        		System.out.println();
	        	}
	        }
	    }
	}
}