#include <bits/stdc++.h>
using namespace std;
const int MAXN = 128;
int k;
bool a[MAXN][MAXN];
void PrintSolution(int n) {
  int i, j;
  printf("%d\n", n + 1);
  for (i = 0; i <= n; ++i) {
    for (j = 0; j <= n; ++j) {
      printf("%d", a[i][j]);
    }
    printf("\n");
  }
}
int main() {
  int i, j, n = 1;
  scanf("%d", &k);
  a[0][1] = a[1][0] = 1;
  while (1) {
    n++;
    a[0][n] = a[n][0] = 1;
    int cnt = 1;
    for (i = 1; i < n; ++i) {
      if (k - cnt >= 0) {
        a[n][i] = a[i][n] = 1;
        k -= cnt;
      }
      cnt++;
      if (k == 0) {
        PrintSolution(n);
        return 0;
      }
    }
  }
  return 0;
}
