#include <bits/stdc++.h>
using namespace std;
int tri[110];
vector<int> v;
string graph[110];
void add_edge(int a, int b) {
  graph[a][b] = '1';
  graph[b][a] = '1';
}
int main(void) {
  int E, i, j;
  cin >> E;
  int K;
  for (K = 100;; K--) {
    int K3 = K * (K - 1) * (K - 2) / 6;
    if (K3 <= E) {
      E -= K3;
      break;
    }
  }
  while (E > 0) {
    for (i = K;; i--) {
      int tmp = i * (i - 1) / 2;
      if (tmp <= E) {
        E -= tmp;
        break;
      }
    }
    v.push_back(i);
  }
  int N = K + v.size();
  for ((i) = 0; (i) < (int)(N); (i)++)
    for ((j) = 0; (j) < (int)(N); (j)++) graph[i] += '0';
  for ((i) = 0; (i) < (int)(K); (i)++)
    for ((j) = 0; (j) < (int)(i); (j)++) add_edge(i, j);
  for ((i) = 0; (i) < (int)(v.size()); (i)++)
    for ((j) = 0; (j) < (int)(v[i]); (j)++) add_edge(K + i, j);
  cout << N << endl;
  for ((i) = 0; (i) < (int)(N); (i)++) cout << graph[i] << endl;
  return 0;
}
