#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return a % b == 0 ? b : gcd(b, a % b); }
const int MAXN = 110;
int G[MAXN][MAXN];
int N;
int main() {
  while (scanf("%d", &N) != EOF) {
    memset(G, 0, sizeof(G));
    int tot = 1;
    G[1][2] = G[2][1] = G[1][3] = G[3][1] = G[2][3] = G[3][2] = 1;
    int leap = 4;
    while (tot < N) {
      int add = (leap - 1) * (leap - 2) / 2;
      if (tot + add <= N) {
        for (int i = 1; i < leap; i++) {
          for (int j = 1; j < i; j++)
            G[i][leap] = G[leap][i] = G[leap][j] = G[j][leap] = G[i][j] =
                G[j][i] = 1;
        }
        tot += add;
        leap++;
      } else {
        tot++;
        G[leap][1] = G[leap][2] = G[2][leap] = G[1][leap] = 1;
        for (int i = 3; i < leap; i++) {
          if (tot + (i - 1) > N) break;
          G[leap][i] = 1;
          G[i][leap] = 1;
          tot += (i - 1);
        }
        leap++;
      }
    }
    printf("%d\n", leap - 1);
    for (int i = 1; i <= leap - 1; i++) {
      for (int j = 1; j <= leap - 1; j++) printf("%d", G[i][j]);
      puts("");
    }
  }
  return 0;
}
