#include <bits/stdc++.h>
using namespace std;
template <class T>
void PV(T x) {
  for (__typeof__((x).begin()) i = (x).begin(); i != (x).end(); i++)
    cout << *i << " ";
  cout << endl;
}
int C(int a, int b) {
  int ret = 1;
  for (int n_ = (b), i = 0; i < n_; ++i) ret = ret * (a - i);
  for (int n_ = (b), i = 0; i < n_; ++i) ret = ret / (i + 1);
  return ret;
}
int main(int argc, char *argv[]) {
  int k;
  cin >> k;
  int a3 = -1;
  for (int i = 100; i >= 3; i--) {
    if (C(i, 3) <= k) {
      k -= C(i, 3);
      a3 = i;
      break;
    }
  }
  int n = a3;
  vector<vector<int> > mat(100, vector<int>(100, 0));
  for (int n_ = (a3), i = 0; i < n_; ++i)
    for (int n_ = (i), j = 0; j < n_; ++j) mat[i][j] = mat[j][i] = 1;
  for (int i = a3; i >= 2; i--) {
    while (C(i, 2) <= k) {
      k -= C(i, 2);
      for (int n_ = (i), j = 0; j < n_; ++j) mat[j][n] = mat[n][j] = 1;
      n++;
    }
  }
  vector<int> ans;
  for (int i = 100; i >= 3; i--)
    while (C(i, 3) <= k) {
      k -= C(i, 3);
      ans.push_back(i);
    }
  for (auto &a : ans) {
    for (int n_ = (a), i = 0; i < n_; ++i)
      for (int n_ = (i), j = 0; j < n_; ++j)
        mat[n + i][n + j] = mat[n + j][n + i] = 1;
    n += a;
  }
  cout << n << endl;
  for (int n_ = (n), i = 0; i < n_; ++i) {
    for (int n_ = (n), j = 0; j < n_; ++j) cout << mat[i][j];
    cout << endl;
  }
  return 0;
}
