#include <bits/stdc++.h>
using namespace std;
long long C(long long n, long long k) {
  long long i, isumn = 1, isumk = 1, isumnk = 1;
  for (i = n - k + 1; i <= n; i++) {
    isumn *= i;
  }
  for (i = 1; i <= k; i++) {
    isumk *= i;
  }
  return (isumn / isumk);
}
long long point = 0, c, a, b, d[1005][1005], point1;
int main() {
  int i, j;
  cin >> a;
  for (i = 3; i <= 100; i++) {
    if (C(i, 3) > a) {
      point = i - 1;
      break;
    }
  }
  if (C(point, 3) == a) {
    for (i = 1; i <= point; i++) {
      for (j = 1; j <= point; j++) {
        if (i == j)
          d[i][j] = 0;
        else
          d[i][j] = 1;
      }
    }
    cout << point << "\n";
    for (i = 1; i <= point; i++) {
      for (j = 1; j <= point; j++) cout << d[i][j];
      cout << "\n";
    }
    return 0;
  } else {
    a = a - C(point, 3);
    for (i = 1; i <= point; i++) {
      for (j = 1; j <= point; j++) {
        if (i == j)
          d[i][j] = 0;
        else
          d[i][j] = 1;
      }
    }
    point1 = point + 1;
    while (a > 0) {
      d[point1][1] = 1;
      d[1][point1] = 1;
      for (i = 2; i <= point; i++) {
        if ((i - 1) * i / 2 <= a) {
          d[point1][i] = 1;
          d[i][point1] = 1;
        }
        if (a == 0) break;
        if ((i - 1) * i / 2 > a) {
          a = a - (i - 2) * (i - 1) / 2;
          break;
        }
      }
      if (a == 0)
        break;
      else
        point1++;
    }
    cout << point1 << "\n";
    for (i = 1; i <= point1; i++) {
      for (j = 1; j <= point1; j++) {
        if (i == j) {
          cout << "0";
        } else {
          if (d[i][j] == 1)
            cout << "1";
          else
            cout << "0";
        }
      }
      cout << "\n";
    }
  }
}
