#include <bits/stdc++.h>
using namespace std;
const int N = 104;
int a[N], b[N], n = 100, k;
int p = 0;
bool z[104][104];
int main() {
  for (int i = 1; i < n; i++) {
    a[i] = i * (i - 1) * (i - 2) / 6;
    b[i] = i * (i - 1) / 2;
  }
  scanf("%d", &k);
  int q = upper_bound(a, a + n, k) - a - 1;
  k -= a[q];
  int x = q;
  for (int i = 1; i <= x; i++)
    for (int j = i + 1; j <= x; j++) z[i][j] = z[j][i] = 1;
  for (; k > 0;) {
    q = upper_bound(b, b + n, k) - b - 1;
    k -= b[q];
    ++x;
    for (int i = 1; i <= q; i++) z[i][x] = z[x][i] = 1;
  }
  printf("%d\n", x);
  for (int i = 1; i <= x; i++) {
    for (int j = 1; j <= x; j++) putchar('0' + z[i][j]);
    puts("");
  }
}
