#include <bits/stdc++.h>
using namespace std;
int K;
int kk[90];
char m[100][110];
int main() {
  for (int(i) = 0; (i) < (90); (i)++) kk[i] = i * (i - 1) * (i - 2) / 6;
  scanf("%d", &K);
  vector<int> v;
  int cl;
  for (int i = 89; i >= 0; i--)
    if (kk[i] <= K) {
      K -= kk[i];
      for (int(j) = 0; (j) < (i); (j)++) v.push_back(i);
      cl = i;
      break;
    }
  for (int(i) = 0; (i) < (90); (i)++) kk[i] = i * (i - 1) / 2;
  for (int i = cl - 1; i >= 2; i--) {
    while (kk[i] <= K) {
      K -= kk[i];
      v.push_back(i);
    }
  }
  printf("%d\n", v.size());
  int N = v.size();
  for (int(i) = 0; (i) < (N); (i)++)
    for (int(j) = 0; (j) < (N); (j)++) m[i][j] = '0';
  for (int(i) = 0; (i) < (N); (i)++)
    for (int(j) = 0; (j) < (v[i]); (j)++) m[i][j] = '1';
  for (int(i) = 0; (i) < (N); (i)++)
    for (int(j) = 0; (j) < (N); (j)++)
      if (m[i][j] == '1') m[j][i] = '1';
  for (int(i) = 0; (i) < (N); (i)++) m[i][i] = '0';
  for (int(i) = 0; (i) < (N); (i)++) printf("%s\n", m[i]);
}
