#include <bits/stdc++.h>
using namespace std;
bool A[200][200];
int total;
int v = 2;
int main() {
  int k;
  cin >> k;
  while (total < k) {
    for (int i = 1; i < v && total + (i - 1) <= k; i++) {
      A[v][i] = A[i][v] = true;
      total += (i - 1);
    }
    v++;
  }
  cout << --v << endl;
  for (int i = 1; i <= v; i++) {
    for (int j = 1; j <= v; j++) cout << A[i][j];
    cout << endl;
  }
}
