#include <bits/stdc++.h>
using namespace std;
int ans[109][109], glo;
int calc(int val) {
  int ans = (val) * (val - 1);
  ans /= 2;
  return ans;
}
void recurse(int k, int vert) {
  if (k == 0) {
    glo = vert;
    return;
  }
  int low = 2;
  int high = vert;
  while (low < high) {
    int mid = (low + high + 1) / 2;
    if (calc(mid) > k)
      high = mid - 1;
    else
      low = mid;
  }
  for (int i = int(1); i <= int(low); i++) {
    ans[i][vert + 1] = 1;
    ans[vert + 1][i] = 1;
  }
  recurse(k - calc(low), vert + 1);
}
int main() {
  int k;
  scanf("%d", &k);
  for (int i = int(1); i <= int(3); i++) {
    for (int j = int(i + 1); j <= int(3); j++) {
      ans[i][j] = 1;
      ans[j][i] = 1;
    }
  }
  recurse(k - 1, 3);
  printf("%d\n", glo);
  for (int i = int(1); i <= int(glo); i++) {
    for (int j = int(1); j <= int(glo); j++) {
      printf("%d", ans[i][j]);
    }
    printf("\n");
  }
  return 0;
}
