#include <bits/stdc++.h>
using namespace std;
void file(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
template <typename Tp>
void read(Tp &x) {
  int fh = 1;
  char c = getchar();
  x = 0;
  while (c > '9' || c < '0') {
    if (c == '-') {
      fh = -1;
    }
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c & 15);
    c = getchar();
  }
  x *= fh;
}
int n, m;
struct node {
  int id, vl;
  bool operator<(node y) const { return vl > y.vl; }
} a[1005];
int b[1005][1005];
signed main() {
  read(n);
  for (int i = 1; i <= n; ++i) {
    read(a[i].vl);
    a[i].id = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= a[i].vl; ++j) {
      b[(i + j - 1) % (n + 1) + 1][a[i].id] = 1;
    }
  }
  printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; ++i) {
    for (int j = 1; j <= n; ++j) printf("%d", b[i][j]);
    puts("");
  }
  return 0;
}
