#include <bits/stdc++.h>
using namespace std;
int read() {
  int w = 0, f = 1;
  char c = ' ';
  while (c < '0' || c > '9') c = getchar(), f = c == '-' ? -1 : f;
  while (c >= '0' && c <= '9') w = w * 10 + c - 48, c = getchar();
  return w * f;
}
struct node {
  int v, pos;
} a[1005];
bool cmp(node x, node y) { return x.v > y.v; }
int n, ans[1005][1005];
signed main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i].v = read(), a[i].pos = i;
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++)
    for (int j = 1, k = i; j <= a[i].v; j++, k = k % (n + 1) + 1)
      ans[k][a[i].pos] = 1;
  printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; i++) {
    for (int j = 1; j <= n; j++) printf("%d", ans[i][j]);
    puts("");
  }
  return 0;
}
