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())
res = []
a = []
i = 2
while(i * i <= k):
    if(k % i == 0):
        a.append(i)
        k //= i
    i += 1
a.append(k)
for i in range(sum(a) + 2):
    res.append([])
    for j in range(sum(a) + 2):
        res[i].append("N")
prev = [0]
vertex = 2
for i in range(len(a)):
    for j in range(a[i]):
        for p in prev:
            res[vertex][p] = "Y"
            res[p][vertex] = "Y"
        vertex += 1
    prev = []
    for j in range(a[i]):
        prev.append(vertex - j - 1)
for i in prev:
    res[i][1] = "Y"
    res[1][i] = "Y"
print(len(res))
for i in range(len(res)):
    for j in range(len(res)):
        print(res[i][j],end = "")
    print()
