#include <bits/stdc++.h>
using namespace std;
int arr[110][110];
int main() {
  int k, n, c, ans = 0, b, l = 0;
  cin >> k;
  for (int i = 0; i < 102; i++)
    for (int j = 0; j < 102; j++) arr[i][j] = 0;
  n = 2;
  while (k > 0) {
    if (k < l) {
      l = 0;
      n++;
    }
    arr[n - 1][l] = 1;
    arr[l][n - 1] = 1;
    k -= l;
    l++;
    if (l >= n - 1 && k > 0) {
      l = 0;
      n++;
    }
  }
  cout << n << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << arr[i][j];
    cout << endl;
  }
  return 0;
}
