记录
题面
#include<bits/stdc++.h>
using namespace std;
int n,len,x,y,tot,minn=0x7f7f7f7f;
char s[25][105];
void fun()
{
minn=0x7f7f7f7f;
x=0;
y=0;
tot++;
scanf("%s",s[tot]+1);
len=strlen(s[tot]+1);
for(int i=1;i<=len;i++)
{
if(s[tot][i]=='N') y++;
if(s[tot][i]=='E') x++;
if(s[tot][i]=='S') y--;
if(s[tot][i]=='W') x--;
minn=min(minn,x);
}
if(minn<0) printf("CCW");
else printf("CW");
if(n!=0) printf("\n");
}
int main()
{
scanf("%d",&n);
while(n--) fun();
return 0;
}