#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long graph[100][100];
int32_t main() {
  c_p_c();
  long long k;
  cin >> k;
  long long arr[101];
  long long arr2[101];
  arr2[2] = 1;
  for (long long i = 3; i <= 100; i++) {
    arr[i] = (i * (i - 1) * (i - 2)) / 6;
    arr2[i] = (i * (i - 1)) / 2;
  }
  vector<long long> store;
  long long idx = lower_bound(arr + 3, arr + 101, k) - arr;
  bool f = binary_search(arr + 3, arr + 101, k);
  if (!f) idx--;
  k -= arr[idx];
  long long key = idx;
  while (k > 0) {
    idx = lower_bound(arr2 + 2, arr2 + 101, k) - arr2;
    bool f = binary_search(arr2 + 2, arr2 + 101, k);
    if (!f) idx--;
    k -= arr2[idx];
    store.push_back(idx);
  }
  long long n = store.size() + key;
  cout << n << endl;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      graph[i][j] = 0;
    }
  }
  for (long long i = 0; i < key; i++) {
    for (long long j = 0; j < key; j++) {
      if (i != j) graph[i][j] = 1;
    }
  }
  idx = key;
  for (long long i = 0; i < store.size(); i++) {
    for (long long j = 0; j < store[i]; j++) {
      graph[idx][j] = 1;
      graph[j][idx] = 1;
    }
    idx++;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cout << graph[i][j];
    }
    cout << endl;
  }
}
