# Arup Guha
# 7/16/2025
# Clockwise Fence USACO Feb 21 Bronze

# Returns the anwser for the string s.
def solve(s):

    # Here are all the left and right turns.
    RIGHT = ["NE", "ES", "SW", "WN"]
    LEFT =  ["EN", "SE", "WS", "NW"]

    # Store how many of each.
    rCnt = 0
    lCnt = 0

    # Go through each turn and count them up.
    for i in range(len(s)-1):

        if s[i:i+2] in RIGHT:
            rCnt += 1
        elif s[i:i+2] in LEFT:
            lCnt += 1

    # Here's what we want to return...
    if rCnt > lCnt:
        return "CW"
    else:
        return "CCW"

# Process cases.
nC = int(input())
for loop in range(nC):
    s = input().strip()
    print(solve(s))
