#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef pair PI; #define REP(i,n) for (int i=0; i=0; i--) #define FOREACH(it,a) for (__typeof(a.begin()) it=a.begin(); it!=a.end(); it++) int vs(PI a, PI b) { return a.first*b.second-a.second*b.first; } int main() { int n; PI a[10000]; while (scanf("%d", &n)==1) { if (!n) break; map > x, y; PI zac; REP(i,n) { scanf("%d %d", &a[i].first, &a[i].second); if (i == 0) zac = a[0]; x[a[i].first].push_back(a[i].second); y[a[i].second].push_back(a[i].first); } map > dalsi; FOREACH(it,x) { sort(it->second.begin(), it->second.end()); vector &o = it->second; for (unsigned i=0; ifirst, o[i])].push_back(PI(it->first, o[i+1])); dalsi[PI(it->first, o[i+1])].push_back(PI(it->first, o[i])); } } FOREACH(it,y) { sort(it->second.begin(), it->second.end()); vector &o = it->second; for (unsigned i=0; ifirst)].push_back(PI(o[i+1], it->first)); dalsi[PI(o[i+1], it->first)].push_back(PI(o[i], it->first)); } } vector obvod; while (true) { obvod.push_back(zac); vector &d = dalsi[zac]; //cout<1 && d[co] == obvod[obvod.size()-2]) co = true; zac = d[co]; if (zac == a[0]) break; } bool clock = false; if (n > 1) { PI tx(obvod[2].first-obvod[1].first, obvod[2].second-obvod[1].second); PI ty(obvod[1].first-obvod[0].first, obvod[1].second-obvod[0].second); if (vs(ty, tx) < 0) clock = true; } if (!clock) reverse(obvod.begin()+1, obvod.end()); string res; REP(i,n) { int d = (i+1)%n; if (obvod[i].first == obvod[d].first) { if (obvod[d].second > obvod[i].second) res+='N'; else res+='S'; } else { if (obvod[d].first > obvod[i].first) res+='E'; else res+='W'; } } printf("%s\n", res.c_str()); } }