#include <bits/stdc++.h>
using namespace std;
const int N = 1003;
int n, nid[N];
int ans[N][N];
struct num {
  int id, v;
} a[N];
bool cmp(num a, num b) { return a.v > b.v; }
int main() {
  scanf("%d", &n);
  for (register int i = 1; i <= n; ++i) scanf("%d", &a[i].v), a[i].id = i;
  sort(a + 1, a + 1 + n, cmp);
  for (register int i = 1; i <= n; ++i) nid[a[i].id] = i;
  for (register int i = 1; i <= n; ++i) {
    int b = n + 2 - i;
    while (b > 0 && a[i].v) a[i].v--, ans[b][i] = 1, b--;
    b = n + 1;
    while (a[i].v) a[i].v--, ans[b][i] = 1, b--;
  }
  printf("%d\n", n + 1);
  for (register int i = 1; i <= n + 1; ++i) {
    for (register int j = 1; j <= n; ++j) printf("%d", ans[i][nid[j]]);
    printf("\n");
  }
  return 0;
}
