#include <bits/stdc++.h>
using namespace std;
int a[105];
int b[105];
int g[105][105];
int main() {
  for (int i = 3; i <= 100; i++) {
    a[i] = i * (i - 1) * (i - 2) / 6;
  }
  for (int i = 2; i <= 100; i++) {
    b[i] = i * (i - 1) / 2;
  }
  int k;
  cin >> k;
  int n = 0;
  int m = 0;
  vector<int> vertice;
  memset(g, 0, sizeof(g));
  for (int i = 100; i >= 3; i--) {
    if (k >= a[i]) {
      k -= a[i];
      n += i;
      m = i;
      for (int j = i; j >= 2; j--) {
        while (k >= b[j]) {
          k -= b[j];
          n += 1;
          vertice.push_back(j);
        }
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= m; j++) {
      g[i][j] = (i == j) ? 0 : 1;
    }
  }
  for (int i = 0; i < vertice.size(); i++) {
    int d = vertice[i];
    for (int j = 1; j <= d; j++) g[j][m + i + 1] = 1;
    for (int j = 1; j <= d; j++) g[m + i + 1][j] = 1;
  }
  cout << n << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << g[i][j];
    }
    cout << endl;
  }
  return 0;
}
