#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
void CI(int &_x) { scanf("%d", &_x); }
void CO(int &_x) { cout << _x; }
template <typename T>
void getarray(T a[], int n) {
  for (int i = 0; i < n; i++) cin >> a[i];
}
template <typename T>
void printarray(T a[], int n) {
  for (int i = 0; i < n - 1; i++) cout << a[i] << " ";
  cout << a[n - 1] << endl;
}
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
int dr8[8] = {1, -1, 0, 0, 1, -1, -1, 1};
int dc8[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dr4[4] = {0, 0, 1, -1};
int dc4[4] = {-1, 1, 0, 0};
int kn8r[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int kn8c[8] = {2, 1, -1, -2, -2, -1, 1, 2};
int dp[105][5];
int nCr(int n, int r) {
  if (r == 1) return n;
  if (n == r) return 1;
  if (r == 0) return 1;
  if (r > n) return 0;
  if (dp[n][r] != -1) return dp[n][r];
  return dp[n][r] = nCr(n - 1, r) + nCr(n - 1, r - 1);
}
int grid[105][105];
int main() {
  memset(dp, -1, sizeof dp);
  nCr(101, 4);
  int node, cycle;
  cin >> cycle;
  for (node = 0; nCr(node, 3) <= cycle; node++)
    ;
  node--;
  cycle = cycle - nCr(node, 3);
  for (int i = 1; i <= node; i++)
    for (int j = 1; j <= node; j++)
      if (i != j) grid[i][j] = 1;
  while (cycle) {
    int nn;
    for (nn = 0; nn <= node && nCr(nn, 2) <= cycle; nn++)
      ;
    nn--;
    node++;
    for (int i = 1; i <= nn; i++) grid[node][i] = 1, grid[i][node] = 1;
    cycle -= nCr(nn, 2);
  }
  cout << node << "\n";
  for (int i = 1; i <= node; i++) {
    for (int j = 1; j <= node; j++) cout << grid[i][j];
    puts("");
  }
}
