#include <bits/stdc++.h>
using namespace std;
bool vis[120][120];
int main() {
  int k, n;
  cin >> k;
  memset(vis, 0, sizeof(vis));
  vis[1][2] = vis[2][1] = true;
  for (int i = 3; i <= 100; i++) {
    n = i;
    for (int j = 1; j < i; j++) {
      int sum = 0;
      for (int l = 1; l < j; l++)
        if (vis[j][l] && vis[i][l]) sum++;
      if (k >= sum) {
        k -= sum;
        vis[i][j] = vis[j][i] = true;
      }
      if (k == 0) break;
    }
    if (k == 0) break;
  }
  cout << n << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << vis[i][j];
    cout << endl;
  }
  return 0;
}
