#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n = 100, k, count = 0;
  cin >> k;
  int a[105][105] = {0};
  for (i = 1; i < n; i++) {
    a[i][0] = a[0][i] = 1;
  }
  for (i = 2; i < n; i++) {
    if (count == k) {
      break;
    }
    for (j = 1; j < i; j++) {
      if (count + j <= k) {
        a[i][j] = a[j][i] = 1;
        count += j;
      } else {
        break;
      }
    }
  }
  n = i;
  cout << n << endl;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cout << a[i][j];
    }
    cout << endl;
  }
  return 0;
}
