#include <bits/stdc++.h>
using namespace std;
int K, N;
vector<int> ret;
int a[111][111];
void xuly() {
  cin >> K;
  N = 1;
  while (N * (N - 1) * (N - 2) < 6 * K) N++;
  N--;
  K -= N * (N - 1) * (N - 2) / 6;
  ret.push_back(N);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= N; j++)
      if (i != j) a[i][j] = 1;
  while (K) {
    int M = 2;
    while (M * (M - 1) / 2 <= K) M++;
    M--;
    K -= M * (M - 1) / 2;
    ret.push_back(M);
    N++;
    for (int i = 1; i <= M; i++) a[i][N] = a[N][i] = 1;
  }
  cout << N << endl;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) cout << a[i][j];
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  xuly();
}
