#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, id[N], a[N], p[N];
bool o[N][N];
int main() {
  scanf("%d", &n);
  register int i, j;
  for (i = 1; i <= n; ++i) scanf("%d", &a[i]), id[i] = i;
  std::sort(id + 1, id + 1 + n,
            [&](const int p, const int q) { return a[p] > a[q]; });
  for (i = 1; i <= n; ++i) p[id[i]] = i;
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= a[id[i]]; ++j)
      o[(j + i - 1) > n + 1 ? j + i - 1 - n - 1 : j + i - 1][i] = 1;
  printf("%d\n", n + 1), ++n;
  for (i = 1; i <= n; puts(""), ++i)
    for (j = 1; j < n; ++j) putchar(o[i][p[j]] + '0');
  return 0;
}
