#include <bits/stdc++.h>
using namespace std;
const int INFint = 2147483647;
const long long INF = 9223372036854775807ll;
const long long MOD = 1000000009ll;
const long double EPS = 1e-9;
int a[111][111];
int main() {
  ios_base::sync_with_stdio(0);
  int k;
  cin >> k;
  int n;
  a[0][1] = a[1][0] = 1;
  for (n = 2; n < 101; n++) {
    if (!k) break;
    for (int i = 0; i < n; i++) {
      if (k < i) break;
      a[n][i] = a[i][n] = 1;
      k -= i;
    }
  }
  cout << n << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << a[i][j];
    cout << endl;
  }
  fprintf(stderr, "\nTIME = %lf\n", 1.0 * clock() / CLOCKS_PER_SEC);
  return 0;
}
