#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long int inf = 1e12;
const long long int N = 100005;
long long int grph[105][105];
int solve() {
  long long int k;
  cin >> k;
  long long int ans = 0, i, j;
  for (i = 100; i >= 2; i--) {
    if (i * (i - 1) * (i - 2) / 6 <= k) {
      break;
    }
  }
  k = k - (i * (i - 1) * (i - 2)) / 6;
  ans += i;
  for (long long int i = 1; i <= ans; i++) {
    for (long long int j = 1; j <= ans; j++) {
      grph[i][j] = (i != j);
    }
  }
  while (k) {
    for (i = 100; i >= 2; i--) {
      if (i * (i - 1) / 2 <= k) {
        break;
      }
    }
    k -= (i * (i - 1)) / 2;
    ans++;
    for (j = 1; j <= i; j++) {
      grph[j][ans] = grph[ans][j] = 1;
    }
  }
  cout << ans << endl;
  for (long long int i = 1; i <= ans; i++, cout << '\n') {
    for (long long int j = 1; j <= ans; j++) {
      cout << grph[i][j];
    }
  }
  return 0;
}
int main() {
  int t;
  t = 1;
  while (t) {
    solve();
    t--;
  }
  return 0;
}
