#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n;
bool ans[N][N];
struct node {
  int num, pl;
} a[N];
bool cmp(node x, node y) {
  return x.num == y.num ? x.pl < y.pl : x.num > y.num;
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &a[i].num);
    a[i].pl = i;
  }
  sort(a + 1, a + n + 1, cmp);
  for (int i = (1); i <= (n); i++) {
    int num = a[i].pl;
    ans[num][n + 2 - i] = 0;
    for (int j = (n + 1 - i); j >= (1); j--) {
      if (a[i].num)
        a[i].num--, ans[num][j] = 1;
      else
        break;
    }
    for (int j = (n + 1); j >= (n + 3 - i); j--) {
      if (a[i].num)
        a[i].num--, ans[num][j] = 1;
      else
        break;
    }
  }
  printf("%d\n", n + 1);
  for (int i = (1); i <= (n + 1); i++) {
    for (int j = (1); j <= (n); j++) printf("%d", ans[j][i]);
    printf("\n");
  }
  return 0;
}
