Five Nights at Freddy's

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Maria has finally got her dream job! She became a professional night guard in a Sky Tower. One of her responsibilities is reporting about unwanted activity in the building. Fortunately for her, she can do her job without even leaving her cozy chair. All she has to do is keep track of cameras that are placed in the skyscraper. To do so she must handle nn different cameras (enumerated from 11 to nn). She wants to create the cycle of transmitting in which she will process information from the cameras. She will look at transition from some camera for one minute and then switch to the next camera on the cycle. Each camera should appear at least once on the cycle. There are some additional constraints. No two neighboring occurrences of the camera ii on the cycle can be more than a_ia\_i places apart. Fortunately for Maria, for each 1i<jn1 \le i < j \le n at least one of a_ia\_i and a_ja\_j is multiple of the other. 

If it is possible, help Maria to create such cycle with length not exceeding 10610^6.

입력

In the first line one integer Z50Z \le 50 is given, denoting number of testcases described in following lines. 

The first line of each test case contains one integer nn, denoting the number cameras in the Sky Tower.

Following line contains a description of cameras. ii-th number denotes the parameter a_ia\_i of the ii-th camera.

출력

For each test case:

If it is impossible to construct such cycle, the first (and only) line of the output should consist of single word "NIE".

If it is possible to construct such cycle, in the first line output single word "TAK". The following line should contain description of a transition cycle. First number mm denotes the length of the cycle. Next mm numbers are numbers of the cameras on the cycle in order they appear on the cycle.

If there are several possible answers, print any of them.

제한

  • n\[1,105]n \in \[1,10^5]
  • a_i\[1,105]a\_i \in \[1,10^5]