#include #include #include #include #include #include using namespace std; #define PRINTF(args...) printf(args) //#define PRINTF(args...) #define FOR(i,a,b) for(int i=(a); i<(int)(b); ++i) #define FORD(i,a,b) for(int i=(a)-1; i>=(int)(b); --i) #define FOREACH(i,C) for(__typeof(C.begin()) i=C.begin(); i!=C.end(); ++i) const int max_n = 1000; struct xy { int x, y; bool vis; xy *p1, *p2; }; inline void add(xy &a, xy &b) { if (a.p1) a.p2 = &b; else a.p1 = &b; } xy pts[max_n]; int array[max_n]; inline bool compare_x(int i, int j) { return pts[i].x < pts[j].x || pts[i].x == pts[j].x && pts[i].y < pts[j].y; } inline bool compare_y(int i, int j) { return pts[i].y < pts[j].y || pts[i].y == pts[j].y && pts[i].x < pts[j].x; } bool testcase() { int n; scanf("%d", &n); if (!n) return false; FOR(i,0,n) { scanf("%d%d", &pts[i].x, &pts[i].y); pts[i].p1 = pts[i].p2 = 0; pts[i].vis = false; array[i] = i; } if (n == 1) { return true; } sort(array, array+n, compare_x); for (int i = 0; i < n; i += 2) { add(pts[array[i]], pts[array[i+1]]); add(pts[array[i+1]], pts[array[i]]); } sort(array, array+n, compare_y); for (int i = 0; i < n; i += 2) { add(pts[array[i]], pts[array[i+1]]); add(pts[array[i+1]], pts[array[i]]); } xy *cur = pts+array[0], *prev = pts[array[0]].p1 == pts+array[1] ? pts[array[0]].p1 : pts[array[0]].p2; bool good = false; while (!cur->vis) { if (cur == pts) good = true; xy *next = cur->p1 == prev ? cur->p2 : cur->p1; if (good) { cur->vis = true; if (next->y > cur->y) printf("N"); else if (next->y < cur->y) printf("S"); else if (next->x < cur->x) printf("W"); else printf("E"); } prev = cur; cur = next; } printf("\n"); return true; } int main() { while(testcase()); return 0; }