#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
pair<int, int> a[1005];
int sol[1005][1005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a, a + n);
  reverse(a, a + n);
  for (int i = 0; i < n; i++) {
    int r = 0;
    while (n + 1 - i < a[i].first) {
      sol[r][a[i].second] = 1;
      r++;
      a[i].first--;
    }
    for (int k = i; k < i + a[i].first; k++) {
      sol[k][a[i].second] = 1;
    }
  }
  printf("%d\n", n + 1);
  for (int i = 0; i < n + 1; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d", sol[i][j]);
    }
    printf("\n");
  }
  return 0;
}
