A Simple Game
题号:NC207617
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Alice and Bob play a game.Initially they have n binary strings (a string which consists of zeroes and ones). They take alternating turns, and Alice is moving first. During each turn, the player has to choose several (at least one) strings and do one of the following operations (you can perform different operations on different strings):

1:choose a character '1', and replace it with '0'.
2:choose a contiguous substring consisting only of characters '0', and replace it with '1'(The length of the substring is at least 2).
For example, if s = "11000",then after operation 1 s can turn into "01000" or "10000". if s = "11000", then after operation 2 s can turn into "1110", "1101" or "111". 
Whoever is unable to choose,loses.You have to determine who wins if they both play optimally.

输入描述:

The first line contains one integer t (1≤ t ≤100) — the number of test cases. Then the test cases follow.

For each test case, the first line contains one integern(1 ≤ n ≤ 10).

There arenlines following, the i-th of which contains a binary string of length not more than 1000.

输出描述:

For each test case print sdzNB if Alice can win and kgNB otherwise.

示例1

输入

复制
2
2
00
1
3
11
11
11

输出

复制
sdzNB
kgNB

说明

For the 1st test case,Alice can choose the second string and perform operation 1 on it,after which the string turns into "0".Then Bob can only perform operation 2 on the first string.
For the 2nd test case,nothing to say,KGNB.