#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 5;
long long n, b[N][N], x;
struct data {
  long long x, id;
} a[N];
bool cmp(data x, data y) { return x.x > y.x; }
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i].x), a[i].id = i;
  sort(a + 1, a + 1 + n, cmp);
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= a[i].x; j++)
      x = i + j - 1, b[(x - 1) % (n + 1) + 1][a[i].id] = 1;
  printf("%lld\n", n + 1);
  for (long long i = 1; i <= n + 1; i++, puts(""))
    for (long long j = 1; j <= n; j++) printf("%lld", b[i][j]);
  return 0;
}
