#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
int k;
char c[111][111];
int main() {
  for (int i = 0; i < 111; i++)
    for (int j = 0; j < 111; j++) c[i][j] = '0';
  scanf("%d", &k);
  int ans = 100;
  while (ans * (ans - 1) * (ans - 2) / 6 > k) ans--;
  for (int i = 0; i < ans; i++)
    for (int j = 0; j < ans; j++)
      if (i != j) c[i][j] = '1';
  k -= (ans * (ans - 1) * (ans - 2) / 6);
  if (k) {
    int t = ans;
    while (k) {
      int v = ans++;
      int x = t;
      while (x * (x - 1) / 2 > k) x--;
      k -= (x * (x - 1) / 2);
      for (int i = 0; i < x; i++) c[i][v] = '1', c[v][i] = '1';
    }
  }
  printf("%d\n", ans);
  for (int i = 0; i < ans; i++) {
    for (int j = 0; j < ans; j++) printf("%c", c[i][j]);
    puts("");
  }
  return 0;
}
