#include <bits/stdc++.h>
using namespace std;
int a[109][109];
int main() {
  int n;
  int k = 3;
  cin >> n;
  for (int i = 1; i <= 3; i++)
    for (int j = i + 1; j <= 3; j++) {
      a[i][j] = 1;
      a[j][i] = 1;
    }
  n--;
  k++;
  while (n) {
    a[1][k] = a[k][1] = 1;
    a[2][k] = a[k][2] = 1;
    n--;
    int lx = 2;
    for (int i = 3; i < k; i++) {
      if (n >= lx) {
        a[i][k] = 1;
        a[k][i] = 1;
        n = n - lx;
      } else
        break;
      lx++;
    }
    k++;
  }
  if (a[1][k] != 1) k--;
  cout << k << endl;
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= k; j++) cout << a[i][j];
    cout << endl;
  }
  return 0;
}
