#include <bits/stdc++.h>
using namespace std;
int n;
struct numbers {
  int num;
  int id;
} a[1050];
int ans[1050][1050], op;
bool cmp(const numbers &x, const numbers &y) { return x.num > y.num; }
void print() {
  for (int p1 = 1; p1 <= op; ++p1) {
    for (int p2 = 1; p2 <= n; ++p2) printf("%d", ans[p1][p2]);
    printf("\n");
  }
  printf("\n");
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i].num);
    a[i].id = i;
  }
  sort(a + 1, a + n + 1, cmp);
  op = n + 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (a[i].num >= j) ans[j][a[i].id] = 1;
    }
  }
  int p = n;
  for (int j = 1; j <= n; ++j) {
    if (ans[p][a[j].id]) {
      swap(ans[p][a[j].id], ans[n + 1][a[j].id]);
    } else {
      swap(ans[a[j].num][a[j].id], ans[p - 1][a[j].id]);
    }
    p--;
  }
  printf("%d\n", op);
  for (int i = 1; i <= op; ++i) {
    for (int j = 1; j <= n; ++j) printf("%d", ans[i][j]);
    printf("\n");
  }
  return 0;
}
