#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
template <typename T>
inline T Abs(T x) {
  return (x >= 0) ? x : -x;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
string toStr(T x) {
  stringstream st;
  st << x;
  string s;
  st >> s;
  return s;
}
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;
const int MAXN = 110;
char g[MAXN][MAXN];
int main() {
  int k;
  cin >> k;
  int cur = 0, n = 100;
  memset(g, '0', sizeof g);
  while (cur != k)
    for (int i = 0; i < (int)(n); i++)
      for (int j = 0; j < (int)(i); j++)
        if (g[i][j] == '0') {
          int t = 0;
          for (int v = 0; v < (int)(n); v++)
            if (v != i && v != j && g[v][i] + g[v][j] == 2 * '1') t++;
          if (cur + t <= k) {
            cur += t;
            g[i][j] = g[j][i] = '1';
          }
        }
  cout << n << endl;
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(n); j++) cout << g[i][j];
    cout << endl;
  }
  return 0;
}
