#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, i, j, m;
  cin >> k;
  bool edge[101][101];
  std::vector<int> nodes;
  nodes.push_back(1);
  nodes.push_back(2);
  nodes.push_back(3);
  memset(edge, false, sizeof(edge));
  edge[1][2] = edge[2][1] = edge[2][3] = edge[3][2] = edge[3][1] = edge[1][3] =
      1;
  int count = 1;
  bool done = false;
  if (k == 1) {
    cout << "3\n011\n101\n110\n";
    return 0;
  }
  for (i = 4; i < 101; i++) {
    int n = nodes.size();
    for (j = 0; j < n; j++) {
      if (!edge[i][nodes[j]]) {
        int inc = 0;
        for (m = 0; m < n; m++) {
          if (edge[nodes[j]][nodes[m]] && edge[nodes[m]][i]) {
            inc++;
          }
        }
        if (count + inc < k)
          count += inc;
        else if (count + inc == k)
          done = true;
        else
          continue;
        edge[i][nodes[j]] = true;
        edge[nodes[j]][i] = true;
        if (done) break;
      }
    }
    nodes.push_back(i);
    if (done) break;
  }
  cout << i << "\n";
  int n = i;
  for (i = 1; i < n + 1; i++) {
    for (j = 1; j < n + 1; j++) {
      if (edge[i][j])
        cout << "1";
      else
        cout << "0";
    }
    cout << "\n";
  }
  return 0;
}
