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 = bin(int(input()))[2:]
n = len(k)
m = n * 3 + 1
g = [['N'] * m for _ in range(m)]


def add(u, v):
    u %= m
    v %= m
    g[u][v] = g[v][u] = 'Y'


add(1, 2)
add(1, 3)
for i in range(1, n):
    add(3 * i - 1, 3 * i + 2)
    add(3 * i - 1, 3 * i + 3)
    add(3 * i, 3 * i + 2)
    add(3 * i, 3 * i + 3)
    add(3 * i + 1, 3 * i + 4)
for i in range(0, n):
    if k[i]:
        add(3 * i + 3, 3 * i + 4)

print(m)
for it in g:
    print(*it, sep='')
