#include <bits/stdc++.h>
using namespace std;
struct aaa {
  int x, y;
} a[1010];
;
int n, i, j, x, ans[1010][1010];
bool cmp(aaa a, aaa b) { return a.x > b.x; }
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i].x);
    a[i].y = i;
  }
  sort(a + 1, a + n + 1, cmp);
  for (i = 1; i <= a[1].x; i++) {
    x = i;
    for (j = 1; j <= n; j++)
      if (a[j].x >= i) {
        ans[x][a[j].y] = 1;
        x++;
        if (x > n + 1) x = 1;
      }
  }
  printf("%d\n", n + 1);
  for (i = 1; i <= n + 1; i++) {
    for (j = 1; j <= n; j++) printf("%d", ans[i][j]);
    puts("");
  }
}
