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 = int(input())
bit_len = len(bin(n)[2:])
ans = [['N']*100 for _ in range(100)]
cnt = 1
d = dict()
pre = [0]
for i in range(bit_len - 1,-1,-1):
    d[i] = cnt + 1
    for x in pre:
        ans[x][cnt + 1] = ans[cnt + 1][x] = 'Y'
        ans[x][cnt + 2] = ans[cnt + 2][x] = 'Y'
    pre = [cnt + 1,cnt + 2]
    cnt += 2
for x in pre:
    ans[x][1] = ans[1][x] = 'Y'
pre = 1
for i in range(bit_len - 2,-1,-1):
    ans[pre][cnt + 1] = ans[cnt + 1][pre] = 'Y'
    pre = cnt + 1
    if (n >> i)&1:
        ans[pre][d[i]] = ans[d[i]][pre] = 'Y'
print(100)
for i in ans:
    print(''.join(i))