#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int maxn = 100;
int a[maxn][maxn];
int k;
void dfs(int cnt) {
  if (cnt == k) {
    printf("%d\n", 100);
    for (int i = 0; i < maxn; ++i) {
      for (int j = 0; j < maxn; ++j) {
        printf("%d", a[i][j]);
      }
      printf("\n");
    }
    exit(0);
  }
  if (cnt > k) return;
  for (int iter = 0; iter < 3; ++iter) {
    int fr = 0;
    int to = 1;
    while (fr == to || a[fr][to]) {
      fr = rand() % 100;
      to = rand() % 100;
    }
    a[fr][to] = 1;
    a[to][fr] = 1;
    int cur = 0;
    for (int i = 0; i < maxn; ++i)
      if (i != fr && i != to && a[i][fr] && a[i][to]) cur++;
    dfs(cnt + cur);
    a[fr][to] = 0;
    a[to][fr] = 0;
  }
}
int main() {
  scanf("%d", &k);
  dfs(0);
  return 0;
}
