#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, N = 1e3 + 3;
int fans[N][N];
bool vis[N];
long long nCr(int n) { return ((n * (n - 1) * (n - 2)) / 6); }
int main() {
  int n, i;
  cin >> n;
  for (i = 1; n; ++i) {
    fans[0][i] = 1;
    fans[i][0] = 1;
    for (int j = 1; j < i; ++j) {
      if (j > n) break;
      fans[i][j] = 1;
      fans[j][i] = 1;
      n -= j;
    }
  }
  cout << i << endl;
  for (int x = 0; x < i; ++x) {
    for (int y = 0; y < i; ++y) {
      cout << fans[x][y];
    }
    cout << "\n";
  }
  return 0;
}
