#include #include using namespace std; struct point{ int id, x, y, h, v; } p[1024]; int sxy(const void* a, const void * b) { if (((point*) a)->x>((point*)b)->x) return 1; else if (((point*)a)->x<((point*)b)->x) { return -1; }else if (((point*)a)->y>((point*)b)->y) { return 1; } else return -1; } int syx(const void* a, const void * b) { if (((point*) a)->y>((point*)b)->y) return 1; else if (((point*)a)->y<((point*)b)->y) { return -1; }else if (((point*)a)->x>((point*)b)->x) { return 1; } else return -1; } int main() { int count ; int hn[1024], vn[1024]; while (scanf("%d", &count), count) { for(int i=0; i< count ; i++) { scanf("%d %d", &p[i].x, &p[i].y); p[i].id=i; } point tmp[1024]; for(int i=0; i< count ; i++) { tmp[i]=p[i]; } qsort(tmp, count, sizeof(point), &sxy); /*for(int i=0; i< count ; i++) { printf("%d ", tmp[i].id); }*/ for(int i=0; i=0; i--) { //printf("a"); r[l++]=res[i]; } for (int i=count-1; i>s; i--) { //printf("b"); r[l++]=res[i]; } //printf(" "); for(int i=0; ip[r[k]].x) { printf("W"); }if (p[r[i]].yp[r[k]].y) { printf("S"); } } printf("\n"); } return 0; }