n = int(input())
while n:
    txt = input().split()
    for i in txt:
        ok = False
        a = list()
        for j in i:
            if j in "qwertyuiopasdfghjklzxcvbnmQWERTYUIOOPASDFGHJKLZXCVBNM":
                a.append(j)
        for k in range(100):
            if len(a) == 2**k:
                ok = True
        if ok:
            print("N", end=" ")
        else:
            print("C",end=" ")  
    print()   
    n -= 1    





e8b524a6b7c5a3d2503217408faf91c0d2864ddb
<mask token>

<mask token>
while n:
    txt = input().split()
    for i in txt:
        ok = False
        a = list()
        for j in i:
            if j in 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOOPASDFGHJKLZXCVBNM':
                a.append(j)
        for k in range(100):
            if len(a) == 2 ** k:
                ok = True
        if ok:
            print('N', end=' ')
        else:
            print('C', end=' ')
    print()
    n -= 1

n = int(input())
while n:
    txt = input().split()
    for i in txt:
        ok = False
        a = list()
        for j in i:
            if j in 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOOPASDFGHJKLZXCVBNM':
                a.append(j)
        for k in range(100):
            if len(a) == 2 ** k:
                ok = True
        if ok:
            print('N', end=' ')
        else:
            print('C', end=' ')
    print()
    n -= 1

n = int(input())
while n:
    txt = input().split()
    for i in txt:
        ok = False
        a = list()
        for j in i:
            if j in "qwertyuiopasdfghjklzxcvbnmQWERTYUIOOPASDFGHJKLZXCVBNM":
                a.append(j)
        for k in range(100):
            if len(a) == 2**k:
                ok = True
        if ok:
            print("N", end=" ")
        else:
            print("C",end=" ")  
    print()   
    n -= 1    




