#include <bits/stdc++.h>
int a[110][110];
int count(int m, int n) {
  if (m == 0 || n == 0) return 1;
  return count(m - 1, n - 1) * m / n;
}
int main() {
  int k, n, m, i, j;
  while (scanf("%d", &k) != EOF) {
    memset(a, 0, sizeof(a));
    for (i = 3; i <= 100; i++) {
      m = count(i, 3);
      if (m >= k) break;
    }
    n = i;
    if (m == k) {
      for (i = 1; i <= n; i++)
        for (j = 1; j <= n; j++) {
          if (i != j) a[i][j] = 1;
        }
    } else {
      n--;
      k -= count(n, 3);
      for (i = 1; i <= n; i++)
        for (j = 1; j <= n; j++) {
          if (i == j)
            a[i][j] = 0;
          else
            a[i][j] = 1;
        }
      while (k) {
        for (i = 3; k >= count(i, 2); i++)
          ;
        k -= count(i - 1, 2);
        n++;
        for (j = 1; j <= i - 1; j++) a[n][j] = a[j][n] = 1;
      }
    }
    printf("%d\n", n);
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        printf("%d", a[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
