#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
int n, a[N], b[N], vi[N][N];
bool com(int x, int y) { return a[x] < a[y]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) b[i] = i;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(b + 1, b + n + 1, com);
  for (int i = 1; i <= n + 1; i++) {
    int x = a[b[i]];
    for (int j = i; j && x; j--, x--) vi[j][b[i]] = 1;
    for (int j = n + 1; x; j--, x--) vi[j][b[i]] = 1;
  }
  printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; i++) {
    for (int j = 1; j <= n; j++) printf("%d", vi[i][j]);
    printf("\n");
  }
  return 0;
}
