#include <bits/stdc++.h>
using namespace std;
char c[181][181];
int n, i, j, k, sum;
bool x;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> k;
  for (i = 1; i <= 100; i++)
    for (j = 1; j <= 100; j++) c[i][j] = '0';
  n = 1;
  while (k > 0) {
    n++;
    for (i = 1; i <= n - 1; i++) {
      if (k - (i - 1) >= 0) {
        k -= i - 1;
        c[n][i] = c[i][n] = '1';
        continue;
      }
      break;
    }
  }
  cout << n << '\n';
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) cout << c[i][j];
    cout << '\n';
  }
  return 0;
}
