#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T Abs(const T& value) {
  return value < 0 ? -value : value;
}
template <typename T>
inline T Sqr(const T& value) {
  return value * value;
}
const int maxn = 110;
int a[maxn][maxn];
int main() {
  int k;
  int n = 0;
  cin >> k;
  while (k > 0) {
    int d = 3;
    while (((d + 1) * d * (d - 1)) / 6 <= k) {
      ++d;
    }
    for (int i = n; i < n + d; ++i)
      for (int j = i + 1; j < n + d; ++j) {
        a[i][j] = 1;
        a[j][i] = 1;
      }
    k -= ((d) * (d - 2) * (d - 1)) / 6;
    int how = 2;
    n += d;
    while (true) {
      how = 1;
      while (((how + 1) * how) / 2 <= k) ++how;
      if (how >= 2) {
        k -= (how * (how - 1)) / 2;
        for (int i = n - d; i < n && how > 0; ++i, --how) {
          a[n][i] = 1;
          a[i][n] = 1;
        }
        ++n;
      } else
        break;
    }
  }
  cout << n << endl;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) cout << a[i][j];
    cout << endl;
  }
  return 0;
}
