시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB95757453062.134%

문제

Dr. Orooji’s twins (Mack and Zack) play soccer. We will assume Mack wears jersey number 18 and Zack wears 17. So, Dr. O has to look for these two numbers when trying to find the twins.

Given a list of 10 numbers, determine if the twins are there.

입력

The first input line contains a positive integer, n, indicating the number of data sets to check. The sets are on the following n input lines, one set per line. Each set consists of exactly 10 single-space-separated distinct integers (each integer between 11 and 99 inclusive) giving the jersey numbers for the players.

출력

Print each input set. Then, on the next output line, print one of four messages (mack, zack, both, none), indicating how many of the twins are in the set. Leave a blank line after the output for each test case.

예제 입력 1

4
11 99 88 17 19 20 12 13 33 44
11 12 13 14 15 16 66 88 19 20
20 18 55 66 77 88 17 33 44 11
12 23 34 45 56 67 78 89 91 18

예제 출력 1

11 99 88 17 19 20 12 13 33 44
zack

11 12 13 14 15 16 66 88 19 20
none

20 18 55 66 77 88 17 33 44 11
both

12 23 34 45 56 67 78 89 91 18
mack