#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1000000001;
int n, k, K;
int result[105][105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> k;
  K = k;
  n = 100;
  for (int i = n; i; i--) {
    for (int j = i + 1; j <= n; j++) {
      int haveAdjacent = 0;
      for (int s = 1; s <= n; s++) haveAdjacent += result[i][s] && result[j][s];
      if (k == 1) {
        assert(k == 1);
      }
      if (k >= haveAdjacent) {
        k -= haveAdjacent;
        result[i][j] = result[j][i] = 1;
      }
    }
  }
  assert(k == 0);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      for (int s = j + 1; s <= n; s++)
        k += result[i][j] && result[i][s] && result[s][j];
    }
  }
  assert(k == K);
  cout << n << "\n";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << result[i][j];
    cout << "\n";
  }
  cout << "\n"
       << "\n";
  return 0;
}
