#include <bits/stdc++.h>
int main() {
  int k;
  char s[100][100 + 1] = {};
  int t;
  std::scanf("%d", &k);
  for (int i(0); i < 100; ++i) std::memset(s[i], '0', sizeof(s[0]) - 1);
  for (int a(0); a < 100; ++a) {
    for (int b(0); b < a; ++b) {
      t = 0;
      for (int c(0); c < 100; ++c) t += (s[a][c] == '1') & (s[b][c] == '1');
      if (t <= k) {
        s[a][b] = s[b][a] = '1', k -= t;
        if (k == 0) goto N;
      }
    }
  }
N:
  std::printf("%d\n", 100);
  for (int i(0); i < 100; ++i) std::puts(s[i]);
  return 0;
}
