#include <bits/stdc++.h>
using namespace std;
long long int cyc(long long int n) { return (n * (n - 1)) / 2; }
int main() {
  long long int k, i, a, j, in1, out1, l, i1;
  vector<pair<long, long> > v1;
  int s1[150][150] = {0};
  cin >> k;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) s1[i][j] = 1;
  k--;
  for (i = 3; k; i++) {
    s1[i][0] = 1;
    s1[i][1] = 1;
    s1[0][i] = 1;
    s1[1][i] = 1;
    for (j = 2; j < i; j++) {
      if (cyc(j + 1) > k) break;
      s1[i][j] = 1;
      s1[j][i] = 1;
    }
    k -= cyc(j);
  }
  cout << i << endl;
  for (i1 = 0; i1 < i; i1++) {
    for (j = 0; j < i; j++) {
      if (i1 == j)
        printf("0");
      else
        printf("%d", s1[i1][j]);
    }
    printf("\n");
  }
  return 0;
}
