#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0, fh = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') fh = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    a = a * 10 + c - 48;
    c = getchar();
  }
  return a * fh;
}
long long a[1005], id[1005], n;
long long ans[1005][1005];
bool cmp(long long first, long long second) { return a[first] > a[second]; }
signed main() {
  n = read();
  for (long long i = 1; i <= n; ++i) a[i] = read(), id[i] = i;
  sort(id + 1, id + 1 + n, cmp);
  for (long long i = 1; i <= n; ++i)
    for (long long j = 1; j <= a[id[i]]; ++j)
      ans[(i + j - 1 - 1) % (n + 1) + 1][id[i]] = 1;
  printf("%lld\n", n + 1);
  for (long long i = 1; i <= n + 1; ++i) {
    for (long long j = 1; j <= n; ++j) putchar(ans[i][j] + '0');
    puts("");
  }
  return 0;
}
