#include <bits/stdc++.h>
using namespace std;
int arr[105][105] = {};
int main() {
  ios::sync_with_stdio(0), ios_base::sync_with_stdio(0), cin.tie(0),
      cout.tie(0);
  ;
  int n, cur = 3;
  cin >> n;
  n--;
  for (int i = 1; i <= 3; ++i) {
    for (int j = 1; j <= 3; ++j) {
      if (i == j) continue;
      arr[i][j] = 1;
      arr[j][i] = 1;
    }
  }
  while (n) {
    ++cur;
    for (int x = 1; x <= 2; ++x) {
      arr[x][cur] = 1;
      arr[cur][x] = 1;
    }
    n--;
    for (int i = 3, c = 2; i <= cur - 1; ++i, c++) {
      if (n >= c) {
        arr[i][cur] = 1;
        arr[cur][i] = 1;
        n -= c;
      } else
        break;
    }
  }
  cout << 100 << "\n";
  for (int i = 1; i <= 100; ++i) {
    for (int j = 1; j <= 100; ++j) cout << arr[i][j];
    cout << "\n";
  }
  return 0;
}
