# @author godmar
T = int(input())
for _i in range(T):
    n = int(input())
    for i in range(n):
        print (f"{'.' * (n-1-i)}C{'.' * (i)}")
