#include <bits/stdc++.h>
using namespace std;
int s, t, k, pk;
bool a[200][200];
int main() {
  cin >> pk;
  s = 0;
  for (int i = 1; i <= 100; ++i)
    for (int j = 1; j < i; ++j)
      for (int k = 1; k < j; ++k) {
        if (!a[i][j] || !a[i][k] || !a[j][k]) {
          t = 1;
          if (!a[i][j]) {
            for (int p = 1; p < i; ++p)
              if (a[i][p] && a[j][p] && p != i && p != j && p != k) ++t;
          }
          if (!a[i][k]) {
            for (int p = 1; p < i; ++p)
              if (a[i][p] && a[k][p] && p != i && p != j && p != k) ++t;
          }
          if (!a[j][k]) {
            for (int p = 1; p < i; ++p)
              if (a[j][p] && a[k][p] && p != i && p != j && p != k) ++t;
          }
          if (t + s <= pk) {
            a[i][j] = a[i][k] = a[j][k] = a[j][i] = a[k][i] = a[k][j] = 1;
            s += t;
            if (s == pk) {
              cout << i << endl;
              for (int p = 1; p <= i; ++p) {
                for (int o = 1; o <= i; ++o) cout << a[p][o];
                cout << endl;
              }
              return 0;
            }
          }
        }
      }
  return 0;
}
