#include <bits/stdc++.h>
using namespace std;
int mat[210][210];
int f[210];
int main() {
  int n, i, j, k, tp, ans;
  for (n = 3; n <= 100; n++) {
    ans = 0;
    for (i = n - 2; i >= 1; i--) {
      ans += i * (n - 1 - i);
    }
    f[n] = ans;
  }
  while (cin >> n) {
    memset(mat, 0, sizeof(mat));
    j = 100, ans = 0, i = 1;
    while (n < f[j] && j >= 3) j--;
    n -= f[j];
    for (i = 1; i <= j; i++)
      for (k = i + 1; k <= j; k++) mat[i][k] = mat[k][i] = 1;
    ans = j;
    while (n != 0) {
      while (n < (j * (j + 1) / 2)) j--;
      n -= ((j * (j + 1)) / 2);
      ans++;
      for (i = 1; i <= j + 1; i++) mat[ans][i] = mat[i][ans] = 1;
    }
    cout << ans << endl;
    for (i = 1; i <= ans; i++) {
      for (j = 1; j <= ans; j++) cout << mat[i][j];
      cout << endl;
    }
  }
}
