n = int(input())

 

for i in range(n):
    s = input()
    i = 0
    even = 0
    odd = 0
    for char in s:
        if i % 2 == 0:
            even+=ord(char)
        else:
            odd+=ord(char)
        i+=1
            
    diff = abs(even-odd)
    
    if diff % 3 == 0 or diff % 5 == 0 or diff % 7 == 0:
        print("Prime String")
    else:
        print("Casual String")
