#include <bits/stdc++.h>
bool map[101][101];
int now, k, n;
int main() {
  scanf("%d", &k);
  for (n = 1; n <= 100; n++) {
    for (int i = 1; i < n; i++) {
      int tmp = 0;
      for (int j = 1; j < n; j++) {
        if (map[i][j] && map[n][j]) tmp++;
      }
      if (now + tmp <= k) {
        map[i][n] = map[n][i] = true;
        now += tmp;
      }
    }
    if (now == k) break;
  }
  printf("%d\n", n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%d", map[i][j]);
    printf("\n");
  }
}
