#include <bits/stdc++.h>
using namespace std;
template <typename _T>
inline void read(_T &_x) {
  int _t, _flag = 0;
  while ((_t = getchar()) != '-' && (_t < '0' || _t > '9'))
    ;
  if (_t == '-') _t = getchar(), _flag = 1;
  _x = _t - '0';
  while ((_t = getchar()) >= '0' && _t <= '9') _x = _x * 10 + _t - '0';
  if (_flag) _x = -_x;
}
const int MAX_N = 500;
int mp[MAX_N + 55][MAX_N + 55];
int n;
int main() {
  read(n);
  mp[1][2] = mp[2][1] = 1;
  int cnt_node = 2;
  int ans = 0;
  for (int i = 3; i <= MAX_N; ++i) {
    cnt_node = max(cnt_node, i);
    mp[1][i] = mp[i][1] = 1;
    for (int j = 2; j < i; ++j) {
      mp[i][j] = mp[j][i] = 1;
      ans += j - 1;
      if (ans == n) break;
      if (ans > n) {
        ans -= j - 1;
        mp[i][j] = mp[j][i] = 0;
        break;
      }
    }
    if (ans == n) break;
  }
  printf("%d\n", cnt_node);
  for (int i = 1; i <= cnt_node; ++i) {
    for (int j = 1; j <= cnt_node; ++j) {
      printf("%d", mp[i][j]);
    }
    printf("\n");
  }
  return 0;
}
