#include <bits/stdc++.h>
using namespace std;
int greedy[100] = {0};
int greedy2[100] = {0};
int main() {
  int k, v = 0;
  cin >> k;
  for (int ii = 99; ii > 0; ii--) {
    int n = (2 + ii) * (1 + ii) * ii / 6;
    if (n <= k) {
      for (int jj = 1; jj <= ii; jj++) {
        greedy[jj] = ii - jj + 1;
      }
      k -= n;
      break;
    }
  }
  for (int ii = 99; ii > 0; ii--) {
    int n = (1 + ii) * ii / 2;
    int m = min(k / n, 99 - ii);
    for (int jj = 1; jj <= ii; jj++) {
      greedy[jj] += m;
    }
    k -= m * n;
  }
  greedy[0] = greedy[1] + 1;
  v = greedy[0] + 1;
  for (int ii = 0; ii < 100; ii++) {
    greedy2[ii] = greedy[ii];
  }
  cout << v << endl;
  for (int ii = 0; ii < v; ii++) {
    for (int jj = 0; jj < v; jj++) {
      if (ii == jj) {
        cout << 0;
      } else if (ii < jj) {
        if (greedy[jj - ii - 1]) {
          cout << 1;
          greedy[jj - ii - 1]--;
        } else {
          cout << 0;
        }
      } else {
        if (greedy2[ii - jj - 1]) {
          cout << 1;
          greedy2[ii - jj - 1]--;
        } else {
          cout << 0;
        }
      }
    }
    cout << endl;
  }
  return 0;
}
