#include <bits/stdc++.h>
using namespace std;
int k;
int values[107];
int n = 0;
int ans[107][107];
int cmb[107];
int main() {
  int i, j, base;
  cin >> k;
  for (i = 3; i <= 100; i++) values[i] = i * (i - 1) * (i - 2) / 6;
  for (i = 2; i <= 100; i++) cmb[i] = i * (i - 1) / 2;
  i = 3;
  while (values[i] < k) i++;
  if (values[i] > k) i--;
  k -= values[i];
  n = i;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (i != j) ans[i][j] = 1;
  while (k) {
    for (i = 2; cmb[i] < k; i++)
      ;
    if (cmb[i] > k) i--;
    k -= cmb[i];
    n++;
    for (j = 1; j <= i; j++) ans[n][j] = ans[j][n] = 1;
  }
  cout << n << '\n';
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) cout << ans[i][j];
    cout << '\n';
  }
  return 0;
}
