#include <bits/stdc++.h>
using namespace std;
bool arr[150][150] = {0};
void print(int n) {
  cout << n << "\n";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << arr[i][j];
    cout << "\n";
  }
}
int main() {
  int k = 0, n = 3, cnt = 1;
  cin >> k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) arr[i][j] = arr[j][i] = 1;
  if (cnt == k) {
    print(n);
    return 0;
  }
  for (int i = 4; i <= 111; i++) {
    n = i;
    for (int j = n - 1; j >= 1; j--) {
      int s = (j * (j - 1)) / 2;
      if (cnt + s <= k) {
        cnt += s;
        while (j > 0) {
          arr[i][j] = 1;
          arr[j][i] = 1;
          j--;
        }
        if (cnt == k) {
          print(n);
          return 0;
        }
      }
    }
  }
  return 0;
}
