#include <bits/stdc++.h>
using namespace std;
struct val {
  int v, id;
  char ans[1010];
} a[1010];
int n;
bool cmp1(val x, val y) { return x.v > y.v; }
bool cmp2(val x, val y) { return x.id < y.id; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i].v), a[i].id = i;
  sort(a + 1, a + n + 1, cmp1), printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; ++i)
    for (int j = 1; j <= n; ++j)
      a[j].ans[i] = ((i - j + n + 1) % (n + 1) < a[j].v) + '0';
  sort(a + 1, a + n + 1, cmp2);
  for (int i = 1; i <= n + 1; ++i, putchar('\n'))
    for (int j = 1; j <= n; ++j) putchar(a[j].ans[i]);
  return 0;
}
