#include <bits/stdc++.h>
using namespace std;
const int MAXN = 199;
int n, i, j, k, bas, now, a[MAXN], b[MAXN][MAXN];
int main() {
  scanf("%d", &n);
  if (n == 0) {
    printf("1\n0\n");
    return 0;
  }
  for (i = 3; i <= 100; i++)
    if (i * (i - 1) * (i - 2) / 6 > n) break;
  bas = i - 1;
  now = bas * (bas - 1) * (bas - 2) / 6;
  for (i = bas + 1; i <= 100; i++) {
    for (j = 1; j < bas; j++)
      if (now + j <= n)
        now += j;
      else {
        a[i] = j - 1;
        break;
      }
  }
  printf("100\n");
  memset(b, 0, sizeof(b));
  for (i = 1; i <= bas; i++)
    for (j = 1; j <= bas; j++)
      if (i != j) b[i][j] = 1;
  for (i = bas + 1; i <= 100; i++)
    for (j = 1; j <= (a[i] == 0 ? 0 : (a[i] + 1)); j++) b[i][j] = b[j][i] = 1;
  for (i = 1; i <= 100; i++) {
    for (j = 1; j <= 100; j++) printf("%d", b[i][j]);
    printf("\n");
  }
  return 0;
}
