#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int N = 1e3 + 11;
int n, b[N][N], c[N];
struct node {
  int a, poi;
} p[N];
bool cmp(const node a, const node b) { return a.a > b.a; }
bool check(int x) {
  for (int i = 1; i <= n; ++i)
    if (b[x][i]) return 0;
  return 1;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> p[i].a, p[i].poi = i;
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; i <= n; ++i) c[p[i].poi] = i;
  for (int i = 1; i <= n; ++i) {
    int now = n + 2 - i;
    for (int j = 1; j <= p[i].a; ++j) {
      b[now--][i] = 1;
      if (now == 0) now = n + 1;
    }
  }
  printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; ++i) {
    for (int j = 1; j <= n; ++j) printf("%d", b[i][c[j]]);
    printf("\n");
  }
  return 0;
}
