#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[101][101] = {0};
  int n = 3, i, j, k, m = 1, s = 0, l = 1;
  cin >> m;
  m--;
  a[1][2] = 1;
  a[1][3] = 1;
  a[2][1] = 1;
  a[2][3] = 1;
  a[3][1] = 1;
  a[3][2] = 1;
  while (m) {
    n++;
    l = 1;
    a[n][1] = 1;
    a[1][n] = 1;
    while (m >= l && l < n - 1) {
      m -= l;
      l++;
      a[n][l] = 1;
      a[l][n] = 1;
    }
  }
  cout << n << endl;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) cout << a[i][j];
    cout << endl;
  }
  return 0;
}
