#include <bits/stdc++.h>
using namespace std;
long long k;
bool check(long long n) {
  if (n * (n - 1) * (n - 2) / 6 <= k) return 1;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> k;
  long long n, lo = 3, hi = 101;
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    if (check(mid))
      n = mid, lo = mid + 1;
    else
      hi = mid - 1;
  }
  long long ans[102][102] = {}, req = k;
  for (long long i = 1; i <= n; i++) {
    for (long long j = i + 1; j <= n; j++) ans[i][j] = ans[j][i] = 1;
  }
  req -= n * (n - 1) * (n - 2) / 6;
  while (req > 0) {
    n++;
    ans[1][n] = ans[n][1] = 1;
    ans[2][n] = ans[n][2] = 1;
    req--;
    if (!req) break;
    for (long long i = 3; i < n && req - i + 1 >= 0; i++) {
      ans[i][n] = ans[n][i] = 1;
      req -= (i - 1);
    }
  }
  cout << n << endl;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) cout << ans[i][j];
    cout << endl;
  }
  return 0;
}
