#include <bits/stdc++.h>
using namespace std;
const int maxn = 128;
int k, x, y, z, i, j;
bool g[maxn][maxn];
void G(int a, int b) { g[a][b] = g[b][a] = true; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> k;
  for (G(0, 3), G(0, 4), x = 3, y = 4, z = 5; k;
       x += 3, y += 3, z += 3, k /= 2) {
    G(x, x + 3);
    G(x, y + 3);
    G(y, y + 3);
    G(y, x + 3);
    G(z, z + 3);
    if (k & 1) G(y, z);
  }
  G(1, z);
  for (cout << 100 << endl, i = 0; i < 100; cout << endl, i++)
    for (j = 0; j < 100; j++)
      if (g[i][j])
        cout << 'Y';
      else
        cout << 'N';
  return 0;
}
