#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  vector<int> used;
  int graph[100][100];
  for (int i = 0; i < 100; i++)
    for (int j = 0; j < 100; j++) graph[i][j] = 0;
  graph[0][1] = 1;
  graph[1][0] = 1;
  graph[1][2] = 1;
  graph[2][1] = 1;
  graph[0][2] = 1;
  graph[2][0] = 1;
  used.push_back(0);
  used.push_back(1);
  used.push_back(2);
  k--;
  while (k) {
    used.push_back(used.size());
    for (int i = 0; i < used.size() - 1 && k > 0; i++) {
      int n = 0;
      for (int j = 0; j < used.size() - 1; j++) {
        if (graph[i][j] && graph[j][used.back()]) n++;
      }
      if (n <= k) {
        graph[i][used.back()] = graph[used.back()][i] = 1;
        k -= n;
      }
    }
  }
  cout << used.size() << endl;
  for (int i = 0; i < used.size(); i++) {
    for (int j = 0; j < used.size(); j++) {
      cout << graph[i][j];
    }
    cout << endl;
  }
}
