#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long q;
  long long w = 0;
  for (long long i = 3; i <= 100; ++i) {
    if (i * (i - 1) * (i - 2) / 6 > n) {
      w = i * (i - 1) * (i - 2) / 6;
      q = i;
      break;
    }
  }
  --q;
  w = q * (q - 1) * (q - 2) / 6;
  long long a, b, c;
  long long r = 0;
  for (long long i = 1; i <= q; ++i) {
    for (long long j = 1; j <= q; ++j) {
      for (long long k = 1; k <= q; ++k) {
        long long lol = i * (i - 1) / 2 + j * (j - 1) / 2 + k * (k - 1) / 2 + w;
        if (lol == n) {
          a = i;
          b = j;
          c = k;
          r = 1;
          goto ohi;
        }
      }
    }
  }
ohi:;
  cout << q + 3 * r << '\n';
  for (long long i = 0; i < q + (3) * r; ++i) {
    for (long long j = 0; j < q + (3) * r; ++j) {
      if (j == i)
        cout << 0;
      else if (i < q && j < q)
        cout << 1;
      else if (i > j) {
        if (i == q && j < a) {
          cout << 1;
        } else if (i == q + 1 && j < b) {
          cout << 1;
        } else if (i == q + 2 && j < c) {
          cout << 1;
        } else
          cout << 0;
      } else {
        if (j == q && i < a)
          cout << 1;
        else if (j == q + 1 && i < b)
          cout << 1;
        else if (j == q + 2 && i < c)
          cout << 1;
        else
          cout << 0;
      }
    }
    cout << '\n';
  }
}
