#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int main() {
  int k, n, f, cnt, g[N][N];
  cin >> k;
  for (int i = 3; i < N; i++)
    if (i * (i - 1) * (i - 2) > k * 6) {
      n = i - 1;
      break;
    }
  cnt = n * (n - 1) * (n - 2) / 6;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) g[i][j] = g[j][i] = 1;
  f = 0;
  while (cnt < k) {
    f++;
    g[n + f][1] = g[1][n + f] = 1;
    for (int i = 2; i <= n; i++) {
      if (cnt + (i - 1) > k) break;
      cnt += (i - 1);
      g[n + f][i] = g[i][n + f] = 1;
    }
  }
  cout << n + f << endl;
  for (int i = 1; i <= n + f; i++) {
    for (int j = 1; j <= n + f; j++) cout << g[i][j];
    cout << endl;
  }
  return 0;
}
