#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double eps = 1e-10;
const double pi = acos(-1.0);
const long long INF = 1LL << 62;
const int inf = 1 << 29;
int k;
char graph[110][110];
void setting(int f, int t) {
  graph[f][t] = graph[t][f] = 'Y';
  return;
}
const int n = 95;
int main(void) {
  cin >> k;
  for (int i = (0); i < (110); ++i)
    for (int j = (0); j < (110); ++j) graph[i][j] = 'N';
  setting(1, 3);
  setting(1, 4);
  for (int i = (0); i < (30); ++i) {
    int f1 = 2 * i + 3, f2 = 2 * i + 4;
    int t1 = 2 * i + 5, t2 = 2 * i + 6;
    setting(f1, t1);
    setting(f2, t1);
    setting(f1, t2);
    setting(f2, t2);
  }
  for (int i = (0); i < (30); ++i) {
    int f = 65 + i, t = 65 + i + 1;
    setting(f, t);
  }
  setting(95, 2);
  for (int i = (0); i < (31); ++i) {
    int f = 2 * i + 4;
    int t = 65 + i;
    if (k & (1 << i)) setting(f, t);
  }
  cout << n << endl;
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (1); j < (n + 1); ++j) cout << graph[i][j];
    cout << endl;
  }
  return 0;
}
