#include <bits/stdc++.h>
using namespace std;
int dcmp(double a, double b) {
  return ((fabs(a - b) < (1e-9)) ? 0 : (a < b) ? -1 : +1);
}
double crossP(const complex<double> &v1, const complex<double> &v2) {
  return (conj(v1) * v2).imag();
}
double dotP(const complex<double> &v1, const complex<double> &v2) {
  return (conj(v1) * v2).real();
}
double lengthSqr(const complex<double> &p) { return dotP(p, p); }
double length(const complex<double> &p) { return hypot(p.real(), p.imag()); }
double fixAngle(double a) { return ((a > 1) ? 1 : (a < -1) ? -1 : a); }
bool same(const complex<double> &p1, const complex<double> &p2) {
  return ((dcmp(p1.real(), p2.real()) == 0 && dcmp(p1.imag(), p2.imag()) == 0)
              ? 1
              : 0);
}
double getAngle_A_abc(double a, double b, double c) {
  return acos(fixAngle((b * b + c * c - a * a) / (2 * b * c)));
}
vector<int> K;
vector<pair<int, vector<pair<int, int>>>> v;
char out[100 + 9][100 + 9];
void build_K() {
  int n = 86;
  K = {0, 0, 0, 1};
  for (__typeof(n + 1) i = 4; i < n + 1; ++i)
    K.emplace_back(i * (i - 1) * (i - 2) / 6);
}
void f(int cycle) {
  while (cycle) {
    auto it = lower_bound(K.begin(), K.end(), cycle);
    int k = it - begin(K), c = *it;
    v.emplace_back(k, vector<pair<int, int>>());
    for (int i = 1; i <= k && c > cycle; i++)
      for (int j = i + 1; j <= k && c > cycle; j++)
        c -= k - j, v.back().second.emplace_back(i, j);
    sort(v.back().second.begin(), v.back().second.end());
    cycle -= c;
  }
}
int build_g() {
  int n = 0;
  for (const auto &a : v) n += a.first;
  if (((int)((v).size())) != 1) n--;
  int pre = 0;
  for (int q = 0; q < ((int)((v).size())); q++) {
    int k = v[q].first;
    const auto &g = v[q].second;
    for (int i = 0; i < k; i++)
      for (int j = 0; j <= i; j++) {
        int ti = i, tj = j;
        if (i != 0 && q) ti += pre;
        if (j != 0 && q) tj += pre;
        if (i == j ||
            binary_search(g.begin(), g.end(), make_pair(i + 1, j + 1)) ||
            binary_search(g.begin(), g.end(), make_pair(j + 1, i + 1)))
          out[ti][tj] = out[tj][ti] = '0';
        else
          out[ti][tj] = out[tj][ti] = '1';
      }
    pre += k - 1;
  }
  return n;
}
void print(int n) {
  for (__typeof(n) i = 0; i < n; ++i)
    for (__typeof(n) j = 0; j < n; ++j)
      if (out[i][j] != '0' && out[i][j] != '1') out[i][j] = '0';
  printf("%d\n", n);
  for (__typeof(n) i = 0; i < n; ++i) printf("%s\n", out[i]);
}
int main() {
  build_K();
  int c;
  scanf("%d", &c);
  f(c);
  int n = build_g();
  print(n);
  return 0;
}
