Fox Ciel wants to write a task for a programming contest. The task is: "You are given a simple undirected graph with *n* vertexes. Each its edge has unit length. You should calculate the number of shortest paths between vertex 1 and vertex 2."

Same with some writers, she wants to make an example with some certain output: for example, her birthday or the number of her boyfriend. Can you help her to make a test case with answer equal exactly to *k*?
The first line contains a single integer *k* (1 ≤ *k* ≤ 10<sup class="upper-index">9</sup>).

k = int(input())
if (k==1):
    print(2)
    print("NY")
    print("YN")
if k == 2:
    print(4)
    
    print("NNYY")
    
    print("NNYY")
    
    print("YYNN")
    
    print("YYNN")
    


if (k>2):
    print(k+2)
    for i in range(1,k+3):
        s = []
        for j in range(1,k+3):
            if (i == 1 and j>=3) or (j ==2 and i>=3):
                s.append('Y')
            else:
                s.append('N')
        print("".join(s))
            