#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
char c[N][N];
int a[N], b[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i), b[i] = i;
  sort(b, b + n, [&](int x, int y) { return a[x] > a[y]; });
  for (int i = 0; i <= n; i++)
    for (int j = 0; j < n; j++) c[i][j] = '0';
  for (int i = 0; i < n; i++) {
    for (int j = 0, k = i; j < a[b[i]]; j++, k++) {
      if (k > n) k = 0;
      c[k][b[i]]++;
    }
  }
  printf("%d\n", n + 1);
  for (int i = 0; i <= n; i++) printf("%s\n", c[i]);
}
