#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  int g[100][100] = {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}, v = 3, c = 1;
  for (; c < k;) {
    ++v;
    g[v - 2][v - 1] = 1;
    g[v - 1][v - 2] = 1;
    g[v - 3][v - 1] = 1;
    g[v - 1][v - 3] = 1;
    ++c;
    for (int i = v - 4, lc = 2; i >= 0 && c < k; --i) {
      if (c + lc > k) break;
      c += lc;
      ++lc;
      g[i][v - 1] = 1;
      g[v - 1][i] = 1;
    }
  }
  printf("%d\n", v);
  for (int i = 0; i < v; ++i) {
    for (int j = 0; j < v; ++j) printf("%d", g[i][j]);
    printf("\n");
  }
  return 0;
}
