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>).
import sys
from collections import deque, Counter, defaultdict
from math import ceil, floor, gcd
from string import ascii_lowercase as chars
from functools import reduce
inf = float("inf")


def input():
    return sys.stdin.readline().rstrip()


def read_ints():
    return map(int, input().split())


def main():
    k = int(input())
    n = 1000
    g = [["N"] * n for _ in range(n)]
    print(n)

    t = k.bit_length() - 1
    print(t)
    x = n

    for i in range(32):
        if k >> i & 1:
            cur = [1]
            for _ in range(i):
                nxt = [x, x-1]
                for i in cur:
                    for j in nxt:
                        g[i-1][j-1] = "Y"
                        g[j-1][i-1] = "Y"
                cur = nxt
                x -= 2
            for _ in range(t-i):
                nxt = [x]
                for i in cur:
                    for j in nxt:
                        g[i-1][j-1] = "Y"
                        g[j-1][i-1] = "Y"
                cur = nxt
                x -= 1

            nxt = [2]
            for i in cur:
                for j in nxt:
                    g[i-1][j-1] = "Y"
                    g[j-1][i-1] = "Y"

    for e in g:
        print("".join(e))
    # for i in range(n):
    #     for j in range(i+1, n):
    #         if g[i][j] == "Y":
    #             print((i+1, j+1))


if __name__ == "__main__":
    t = 1
    # t = int(input())
    for _ in range(t):
        main()
