#include <bits/stdc++.h>
using namespace std;
const long double INF = 1LL << 60, EPS = 1LL >> 60;
int in() {
  char c;
  bool g = false;
  while (c = getchar(), c < '0' || c > '9')
    if (c == '-')
      g = true;
    else
      g = false;
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return g ? -x : x;
}
void out(int x) {
  int len = 0, data[20];
  while (x) {
    data[len++] = x % 10;
    x /= 10;
  }
  if (!len) data[len++] = 0;
  if (data[0] != abs(data[0])) putchar('-');
  while (len--) putchar(abs(data[len]) + 48);
}
void out(string s) {
  int len = 0;
  while (len++ < s.size()) putchar(s[len - 1]);
  putchar('\n');
}
bool a[200][200];
int main() {
  int k = in(), v = 1;
  while (k) {
    for (int i = 0; i < v && i <= k; i++) a[v][i] = a[i][v] = 1, k -= i;
    v++;
  }
  out(v);
  out("");
  for (int i = 0; i < v; i++, out(""))
    for (int j = 0; j < v; j++) out(a[i][j]);
  return 0;
}
