#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 4;
struct seg {
  int l, r;
  seg() {}
  seg(int _l, int _r) {}
  inline friend bool operator<(seg A, seg B) {
    return (A.l == B.l) ? (A.r < B.r) : (A.l < B.l);
  }
};
int n, a[N], op, num, res, ret[N][N], b[N][N];
int main() {
  scanf("%d", &n);
  if (n == 1) return puts("1\n1"), 0;
  for (register int i = (1); i <= (n); ++i)
    scanf("%d", a + i), res += min(a[i], n - a[i]);
  op = n + 1;
  for (register int i = (1); i <= (op); ++i) b[0][i] = 1;
  num = 1;
  for (register int i = (1); i <= (n); ++i) {
    static int rem, ink;
    static basic_string<int> dan;
    dan.clear();
    if (a[i] < op - a[i])
      rem = a[i], ink = 1;
    else
      rem = op - a[i], ink = 0;
    for (register int l = (1); l <= (op); ++l) ret[i][l] = !ink;
    for (register int l = (1); l <= (op); ++l) {
      int r = l;
      while (r < op && b[i - 1][l] == b[i - 1][r + 1]) ++r;
      if (l == r) {
        b[i][l] = b[i - 1][l], dan += l;
        continue;
      } else {
        if (rem) {
          b[i][l] = ++num, rem--, ret[i][l] = ink;
        } else
          b[i][l] = b[i - 1][l];
        for (register int p = (l + 1); p <= (r); ++p) b[i][p] = b[i - 1][p];
      }
      l = r;
    }
    if (rem) {
      for (register int l = (1); l <= (op); ++l) {
        int r = l;
        while (r < op && b[i - 1][l] == b[i - 1][r + 1]) ++r;
        if (l != r) {
          if (rem) {
            int it = l + 1;
            while (it != r && rem)
              ret[i][it] = ink, b[i][it] = b[i][l], ++it, rem--;
          }
        } else if (rem)
          rem--, ret[i][l] = ink;
        l = r;
      }
    }
  }
  printf("%d\n", op);
  for (register int i = (1); i <= (op); ++i) {
    for (register int j = (1); j <= (n); ++j) printf("%d", ret[j][i]);
    putchar('\n');
  }
  return 0;
}
