#include <bits/stdc++.h>
using namespace std;
bool grid[105][105];
int main() {
  int node, k, cycles = 0;
  scanf("%d", &k);
  grid[1][2] = grid[2][1] = 1;
  for (node = 3; node <= 100; node++) {
    grid[1][node] = grid[node][1] = 1;
    for (int i = 2; i < node; i++) {
      int new_cycles = i - 1;
      if (cycles + new_cycles > k) break;
      grid[i][node] = grid[node][i] = 1;
      cycles += new_cycles;
    }
    if (cycles == k) break;
  }
  printf("%d\n", node);
  for (int i = 1; i <= node; i++) {
    for (int j = 1; j <= node; j++) printf("%d", grid[i][j]);
    printf("\n");
  }
}
