#include <bits/stdc++.h>
using namespace std;
const long long int MAX = 10000000000000000;
const long double eps = 0.000000001;
int main() {
  int k;
  cin >> k;
  int n = 3;
  vector<int> armar;
  while (n * (n - 1) * (n - 2) <= k * 6) n++;
  n--;
  k -= n * (n - 1) * (n - 2) / 6;
  while (k > 0) {
    int res = 0;
    while (res * (res - 1) <= k * 2) res++;
    res--;
    k -= res * (res - 1) / 2;
    armar.push_back(res);
  }
  cout << n + armar.size() << endl;
  for (int i = (int)0; i < (int)(n); i++) {
    for (int j = (int)0; j < (int)(n); j++) {
      if (i == j)
        cout << 0;
      else
        cout << 1;
    }
    for (int j = (int)0; j < (int)(armar.size()); j++) {
      if (i < armar[j])
        cout << 1;
      else
        cout << 0;
    }
    cout << endl;
  }
  for (int i = (int)0; i < (int)(armar.size()); i++) {
    for (int j = (int)0; j < (int)(n + armar.size()); j++) {
      if (j < armar[i])
        cout << 1;
      else
        cout << 0;
    }
    cout << endl;
  }
}
