#include <bits/stdc++.h>
using namespace std;
int a[200], b[200];
int matrix[200][200];
int k, n, sta, need;
int A(int x, int y) {
  int res = 1;
  for (int i = 1; i <= y; i++) {
    res *= x;
    x -= 1;
  }
  return res;
}
int C(int x, int y) {
  if (x < y) return 0;
  return A(x, y) / A(y, y);
}
void continue_find() {
  if (!need) return;
  int t;
  t = (int)(lower_bound(b + 1, b + 1 + 100, need) - b);
  if (b[t] > need) t--;
  for (int i = 1; i <= t; i++) {
    matrix[i][sta] = 1;
    matrix[sta][i] = 1;
  }
  sta++;
  need -= b[t];
  if (!need)
    return;
  else
    continue_find();
}
int main() {
  for (int i = 1; i <= 110; i++) {
    a[i] = C(i, 3);
    b[i] = C(i, 2);
  }
  cin >> k;
  int t;
  t = (int)(lower_bound(a + 1, a + 1 + 100, k) - a);
  if (a[t] > k) t--;
  need = k - a[t];
  for (int i = 1; i <= t; i++) {
    for (int j = 1; j <= t; j++) {
      if (i == j) continue;
      matrix[i][j] = 1;
    }
  }
  sta = t + 1;
  continue_find();
  printf("%d\n", sta - 1);
  for (int i = 1; i <= sta - 1; i++) {
    for (int j = 1; j <= sta - 1; j++) {
      if (i == j)
        printf("%d", 0);
      else
        printf("%d", matrix[i][j]);
    }
    printf("\n");
  }
}
