#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 2;
int a[102][102];
int main() {
  ios::sync_with_stdio(false);
  int k, p;
  cin >> k;
  for (int i = 3; i * (i - 1) / 2 * (i - 2) / 3 <= k; p = i++)
    ;
  for (int i = 1; i < p; ++i)
    for (int j = 0; j < i; ++j) a[i][j] = a[j][i] = 1;
  k -= p * (p - 1) * (p - 2) / 6;
  while (k) {
    int i;
    for (i = 2; i * (i - 1) / 2 <= k; ++i)
      ;
    --i;
    k -= i * (i - 1) / 2;
    for (int j = 0; j < i; ++j) a[j][p] = a[p][j] = 1;
    ++p;
  }
  cout << p << endl;
  for (int i = 0; i < p; ++i) {
    for (int j = 0; j < p; ++j) cout << a[i][j];
    cout << endl;
  }
  return 0;
}
