#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int dx[] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int N = 2E2 + 5, M = 2E6 + 10, MOD = 1E9 + 7;
int k, n, grid[N][N];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> k;
  for (n = 1; (n <= 100) & (k > 0); ++n) {
    for (int i = 1; (i < n) & (k >= i - 1); ++i) {
      grid[i][n] = grid[n][i] = 1;
      k -= i - 1;
    }
  }
  cout << --n << '\n';
  for (int i = 1; i <= n; ++i, cout << '\n')
    for (int j = 1; j <= n; ++j) cout << grid[i][j];
  return 0;
}
