#include <bits/stdc++.h>
using namespace std;
int n;
int a[2005];
int id[2005], nid[2005];
int x[2005][2005];
bool cmp(int x, int y) { return a[x] > a[y]; }
signed main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    id[i] = i;
  }
  sort(id + 1, id + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    nid[id[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= a[id[i]]; j++) {
      x[(j + i - 1) > n + 1 ? j + i - 1 - n - 1 : j + i - 1][i] = 1;
    }
  }
  printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; i++) {
    for (int j = 1; j <= n; j++) {
      putchar(x[i][nid[j]] + 48);
    }
    printf("\n");
  }
  return 0;
}
