#include <bits/stdc++.h>
using namespace std;
const int MAX_N = (200);
int g[MAX_N][MAX_N], K;
int Count(int n, int m) {
  if (m == 1) return n;
  return n * Count(n - 1, m - 1) / m;
}
int main() {
  while (cin >> K) {
    int left, N = 100;
    memset(g, 0, sizeof(g));
    for (int i = (3); i <= (100); ++i) {
      if ((left = Count(i, 3)) >= K) {
        left -= K, N = i;
        break;
      }
    }
    if (left == 0) {
      for (int i = (1); i <= (N); ++i) {
        for (int j = (1); j <= (N); ++j) g[i][j] = (i == j ? 0 : 1);
      }
    } else {
      --N;
      left = K - Count(N, 3);
      for (int i = (1); i <= (N); ++i) {
        for (int j = (1); j <= (N); ++j) g[i][j] = (i == j ? 0 : 1);
      }
      while (left) {
        int p = 2;
        while (Count(p, 2) <= left) ++p;
        left -= Count(p - 1, 2);
        ++N;
        for (int i = (1); i <= (p - 1); ++i) {
          g[i][N] = g[N][i] = 1;
        }
      }
    }
    cout << N << endl;
    for (int i = (1); i <= (N); ++i) {
      for (int j = (1); j <= (N); ++j) cout << g[i][j];
      cout << endl;
    }
  }
  return 0;
}
