#include <bits/stdc++.h>
char am[123][123];
int main() {
  int k;
  scanf("%d", &k);
  am[0][2] = am[2][0] = am[0][3] = am[3][0] = 1;
  for (int i = 2; i < 65; i += 2) {
    am[i][i + 2] = am[i + 2][i] = am[i][i + 3] = am[i + 3][i] =
        am[i + 1][i + 2] = am[i + 2][i + 1] = am[i + 1][i + 3] =
            am[i + 3][i + 1] = 1;
  }
  for (int i = 0; i <= 31; i++)
    if (k & (1 << i)) am[2 * i + 2][70 + i] = am[70 + i][2 * i + 2] = 1;
  for (int i = 0; i < 31; i++) am[70 + i][71 + i] = am[71 + i][70 + i] = 1;
  am[70 + 31][1] = am[1][70 + 31] = 1;
  printf("110\n");
  for (int i = 0; i < 110; i++) {
    for (int j = 0; j < 110; j++) putchar(am[i][j] ? 'Y' : 'N');
    putchar('\n');
  }
  return 0;
}
