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>).
n, m, cnt = int(input()), 148, 0
ans = [['N'] * m for i in range(m)]

def edge(i, j):
    ans[i][j] = ans[j][i] = 'Y'

def node(*adj):
    global cnt
    i = cnt
    cnt += 1
    for j in adj:
        edge(i, j)
    return i

start, end, choice = node(), node(), node()
if n&1:
    edge(choice, end)
for i in range(1, 30):
    end, choice = node(node(end), node(end)), node(node(choice))
    if n&(1<<i):
        edge(choice, end)
edge(start, choice)

print(m)
for line in ans:
    print(''.join(line))




# Made By Mostafa_Khaled