{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tAfter centuries of hostilities and skirmishes between the four nations living in the land generally known as \u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"2\"\u003eNlogonia\u003c/span\u003e, and years of negotiations involving diplomats, politicians and the armed forces of all interested parties, with mediation by UN, NATO, \u003cspan data-scayt_word\u003d\"G7\" data-scaytid\u003d\"3\"\u003eG7\u003c/span\u003e and SBC, it was at last agreed by all the way to end the dispute, dividing the land into four independent territories.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tIt was agreed that one point, called \u003ci\u003edivision point\u003c/i\u003e, with coordinates established in the negotiations, would define the country division, in the following way. Two lines, both containing the division point, one in the North-South direction and one in the East-West direction, would be drawn on the map, dividing the land into four new countries. Starting from the Western-most, Northern-most quadrant, in clockwise direction, the new countries will be called Northwestern \u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"4\"\u003eNlogonia\u003c/span\u003e, Northeastern \u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"5\"\u003eNlogonia\u003c/span\u003e, Southeastern \u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"6\"\u003eNlogonia\u003c/span\u003e and Southwestern \u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"7\"\u003eNlogonia\u003c/span\u003e.\u003c/p\u003e\r\n\u003ccenter\u003e\r\n\t\u003cimg src\u003d\"http://uva.onlinejudge.org/external/114/p11498.png\" /\u003e\u003c/center\u003e\r\n\u003c!--\r\nFicou decidido que um ponto, denominado \\emph{ponto divisor}, cujas\r\ncoordenadas foram estabeledicas nas negociações, definiria a divisão\r\ndo país, da seguinte maneira. Duas linhas, ambas contendo o ponto\r\ndivisor, uma na direção Norte-Sul e uma na direção Leste-Oeste, seriam\r\ntraçadas no mapa, dividindo o país em quatro novos países. Iniciando\r\nno quadrante mais ao norte e mais ao oeste, em sentido horário, os\r\nnovos países seriam chamados de Nlogônia do Noroeste, Nlogônia do\r\nNordeste, Nlogônia do Sudeste e Nlogônia do Sudoeste.\r\n\r\n\\begin{center}\r\n\\epsfig{file\u003dnlog.eps}\r\n\\end{center}\r\n--\u003e\u003cp\u003e\r\n\tThe UN determined that a page in the Internet should exist so that the inhabitants could check in which of the countries their homes are. You have been hired to help implementing the system.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe input contains several test cases. The first line of a test case contains one integer\u0026nbsp;\u003ci\u003eK\u003c/i\u003e\u0026nbsp;indicating the number of queries that will be made (\u003ci\u003e0 \u0026lt; K \u0026le; 10\u003csup\u003e3\u003c/sup\u003e\u003c/i\u003e). The second line of a test case contains two integers\u0026nbsp;\u003ci\u003eN\u003c/i\u003e\u0026nbsp;and\u0026nbsp;\u003ci\u003eM\u003c/i\u003e\u0026nbsp;representing the coordinates of the division point (\u003ci\u003e-10\u003csup\u003e4\u003c/sup\u003e\u0026nbsp;\u0026lt; N, M \u0026lt; 10\u003csup\u003e4\u003c/sup\u003e\u003c/i\u003e). Each of the\u0026nbsp;\u003ci\u003eK\u003c/i\u003e\u0026nbsp;following lines contains two integers\u0026nbsp;\u003ci\u003eX\u003c/i\u003e\u0026nbsp;and\u0026nbsp;\u003ci\u003eY\u003c/i\u003e\u0026nbsp;representing the coordinates of a residence (\u003ci\u003e-10\u003csup\u003e4\u003c/sup\u003e\u0026nbsp;\u0026le; X, Y \u0026le; 10\u003csup\u003e4\u003c/sup\u003e\u003c/i\u003e).\u003c/p\u003e\r\n\u003cp\u003e\r\n\tThe end of input is indicated by a line containing only the number zero.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tFor each test case in the input your program must print one line containing:\u003c/p\u003e\r\n\u003cul\u003e\r\n\t\u003cli\u003e\r\n\t\tthe word\u0026nbsp;\u003cfont face\u003d\"courier\"\u003e\u003cspan data-scayt_word\u003d\"divisa\" data-scaytid\u003d\"24\"\u003edivisa\u003c/span\u003e\u003c/font\u003e\u0026nbsp;(means border in Portuguese) if the residence is on one of the border lines (North-South or East-West);\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\t\u003cfont face\u003d\"courier\"\u003eNO\u003c/font\u003e\u0026nbsp;(means NW in Portuguese) if the residence is in Northwestern\u0026nbsp;\u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"25\"\u003eNlogonia\u003c/span\u003e;\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\t\u003cfont face\u003d\"courier\"\u003eNE\u003c/font\u003e\u0026nbsp;if the residence is in Northeastern\u0026nbsp;\u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"26\"\u003eNlogonia\u003c/span\u003e;\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\t\u003cfont face\u003d\"courier\"\u003eSE\u003c/font\u003e\u0026nbsp;if the residence is in Southeastern\u0026nbsp;\u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"29\"\u003eNlogonia\u003c/span\u003e;\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\t\u003cfont face\u003d\"courier\"\u003eSO\u003c/font\u003e\u0026nbsp;(means SW in Portuguese) if the residence is in Southwestern\u0026nbsp;\u003cspan data-scayt_word\u003d\"Nlogonia\" data-scaytid\u003d\"30\"\u003eNlogonia\u003c/span\u003e.\u003c/li\u003e\r\n\u003c/ul\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n3\r\n2 1\r\n10 10\r\n-10 1\r\n0 33\r\n4\r\n-1000 -1000\r\n-1000 -1000\r\n0 0\r\n-2000 -10000\r\n-999 -1001\r\n0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\nNE\r\n\u003cspan data-scayt_word\u003d\"divisa\" data-scaytid\u003d\"33\"\u003edivisa\u003c/span\u003e\r\nNO\r\n\u003cspan data-scayt_word\u003d\"divisa\" data-scaytid\u003d\"34\"\u003edivisa\u003c/span\u003e\r\nNE\r\nSO\r\nSE\u003c/pre\u003e"}}]}