#include <bits/stdc++.h>
using namespace std;
const int nmax = 101;
const int MOD = 1000000007;
bool con[nmax][nmax];
int main() {
  int n, i, j, k, s, m;
  cin >> m;
  for (n = 3;; n++)
    if (n * (n - 1) * (n - 2) / 6 > m) break;
  --n;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      if (i != j) con[i][j] = true;
  m -= n * (n - 1) * (n - 2) / 6;
  for (i = n; m > 0; i++) {
    for (j = 2; j <= n; j++)
      if (j * (j - 1) / 2 > m) break;
    --j;
    m -= j * (j - 1) / 2;
    for (--j; j >= 0; j--) con[j][i] = con[i][j] = true;
  }
  cout << 100 << endl;
  for (i = 0; i < 100; i++) {
    for (j = 0; j < 100; j++) printf("%d", con[i][j] ? 1 : 0);
    puts("");
  }
  return 0;
}
