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, t = 901, format(int(input()), 'b')
t = [i for i in range(len(t)) if t[i] == '1']

p = [['N'] * n for i in range(n)]
def f(i, j): p[i][j] = p[j][i] = 'Y'

for i in range(2, 30): f(i, i + 1)
f(30, 1)

for i in range(29):
	b = 31 + i * (i + 1)
	for a in range(b, b + 2 * i, 2):
		f(a, a + 2)
		f(a, a + 3)
		f(a + 1, a + 2)
		f(a + 1, a + 3)
	a = b + 2 * i
	if i < 28:
		f(a, i + 3)
		f(a + 1, i + 3)
	else:
		f(a, 1)
		f(a + 1, 1)

for i in t:
	if i == 0: f(0, 1)
	else:
		j = 31 + (i - 1) * i
		f(0, j)
		f(0, j + 1)

print(n)
for i in p: print(''.join(i))