There are N islands in the sea, enumerated from 1 to N. Each of them is so small that we can consider them as points on a plane. You are given the Cartesian coordinates of all islands. X-axis is directed towards East and Y-axis is directed towards North.
You need to illuminate all the islands. To do this, you can place lighthouses on some of the islands. You can't place more than one lighthouse on any single island. Each lighthouse can light only one of the 4 quadrants: North-Western, North-Eastern, South-Western or South-Eastern. If some island is located on the border of an illuminated quadrant, it is considered to be illuminated as well. Note that this means that a lighthouse always illuminates it's own island as well.
Find the smallest possible number of lighthouses required to illuminate all the islands (say L). Describe their configurations — positions and quadrants illuminated — as well.

-----Input-----
The first line of input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains a single integer N denoting the number of islands.
The ith of the following N lines contains two integers Xi and Yi denoting the coordinates of the ith island.

-----Output-----
For each test case, first line of output must contain minimum number of lighthouses required to illuminate all islands, L.
Following L lines must describe configuration of the lighthouses, one configuration per line. Description of a lighthouse configuration consists of the number of the island where the lighthouse is placed, and the direction of the quadrant (NW for North-Western, NE for North-Eastern, SW for South-Western, SE for South-Eastern) illuminated by it, separated by a single space.
If there are many possible placements, output any one of them.

-----Constraints-----
- 1 ≤ T ≤ 1000
- 1 ≤ N ≤ 105
- The sum of N over all test cases doesn't exceed 5*105
- Absolute value of each coordinate doesn't exceed 109
- No two given islands coincide.

-----Subtasks-----
Subtask 1: (15 points)
- 1 ≤ N ≤ 8
- Absolute value of each coordinate doesn't exceed 50

Subtask 2: (85 points)
- Original constraints

-----Example-----
Input:
2
5
0 0
1 0
2 0
0 -1
0 -2
4
5 0
-5 0
0 5
0 -5

Output:
1
3 SW
2
4 NE
2 NE

-----Explanation-----
Example case 1. Also we can place lighthouse on 1st or 5th island.
Example case 2. Notice that some islands can be illuminated by more than 1 lighthouse.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "t= int(input())\nfor _ in range(t):\n n = int(input())\n ar = []\n y = []\n for i in range(n):\n  ar.append( list(map(int,input().split())) )\n  y.append(ar[-1][1])\n  ar[-1].append(i)\n \n y.sort()\n mny = y[0]\n mxy = y[-1]\n ar.sort()\n ssx,ssy,ssi = ar[0]\n bbx,bby,bbi = ar[-1]\n \n sbx,sby,sbi = ar[0]\n bsx,bsy,bsi = ar[-1]\n \n for i in range(len(ar)):\n  if ar[i][0]>ssx:\n   sbx,sby,sbi = ar[i-1]\n   break\n \n for i in range(len(ar)-1,-1,-1):\n  if ar[i][0]<bsx:\n   bsx,bsy,bsi = ar[i+1]\n   break \n \n if (ssy <=mny):\n  print(1)\n  print(ssi+1,'NE')\n  continue\n if (sby>=mxy):\n  print(1)\n  print(sbi+1,'SE')\n  continue\n if (bsy <=mny):\n  print(1)\n  print(bsi+1,'NW')\n  continue\n if (bby>=mxy):\n  print(1)\n  print(bbi+1,'SW')\n  continue \n \n print(2)\n if(ssy<bby):\n  print(ssi+1,'NE')\n  print(bbi+1,'SW')\n else:\n  print(ssi+1,'SE')\n  print(bbi+1,'NW')\n \n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14039