#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, val, tot = 0, i, j, k, conn;
  cin >> n;
  for (val = 3; (val * (val - 1) * (val - 2)) <= 6 * n; val++)
    ;
  val--;
  n -= (val * (val - 1) * (val - 2)) / 6;
  vector<int> v;
  while (n) {
    for (conn = 2; conn * (conn - 1) <= 2 * n; conn++)
      ;
    conn--;
    n -= (conn * conn - conn) / 2;
    v.push_back(conn);
    tot++;
  }
  vector<vector<int> > g(val + tot, vector<int>(val + tot, 0));
  for (i = 0; i < val; i++)
    for (j = 0; j < val; j++)
      if (i != j) g[i][j] = 1;
  for ((i) = 0; (i) < (v.size()); (i)++)
    for ((j) = 0; (j) < (v[i]); (j)++) g[i + val][j] = g[j][i + val] = 1;
  cout << g.size() << endl;
  for ((i) = 0; (i) < (g.size()); (i)++) {
    for ((j) = 0; (j) < (g.size()); (j)++) cout << g[i][j];
    cout << endl;
  }
  return 0;
}
