// Arup Guha
// 3/5/2021
// Solution to 2021 February USACO Bronze Problem: Clockwise Fence

import java.util.*;

public class clockwise {

	// Store all the relevant turns.
	final public static String[] left = {"WS", "EN", "SE", "NW"};
	final public static String[] right = {"WN", "ES", "SW", "NE"};

	public static void main(String[] args) {
	
		// stores counts for each turn that matters.
		HashMap<String,Integer> mapCnt = new HashMap<String,Integer>();
		for (int i=0; i<left.length; i++) mapCnt.put(left[i], -1);
		for (int i=0; i<right.length; i++) mapCnt.put(right[i], 1);
	
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		
		// Process all of the cases.
		for (int loop=0; loop<nC; loop++) {
		
			// Get this string.
			String dir = stdin.next();
			
			int cnt = 0;
			
			// Go through each turn, add to score if it's really a turn.
			for (int i=0; i<dir.length()-1; i++) {
				String tmp = dir.substring(i, i+2);
				if (mapCnt.containsKey(tmp))
					cnt += mapCnt.get(tmp);
			}
			
			// Ta da!
			if (cnt > 0)
				System.out.println("CW");
			else
				System.out.println("CCW");
		}
	}
}