#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, vertex = 2, matrix[100][100] = {0}, i = 0;
  cin >> k;
  while (k > 0) {
    if (k < i) i = 0, vertex++;
    matrix[vertex - 1][i] = 1;
    matrix[i][vertex - 1] = 1;
    k -= i;
    i++;
    if (i >= vertex - 1 && k > 0) i = 0, vertex++;
  }
  cout << vertex << "\n";
  for (int i = 0; i < vertex; i++) {
    for (int j = 0; j < vertex; j++) {
      cout << matrix[i][j];
    }
    cout << "\n";
  }
  return 0;
}
