#include <bits/stdc++.h>
using namespace std;
int n, m;
struct Data {
  int x, y;
} f[1109];
bool cmp(const Data &A, const Data &B) { return A.x > B.x; }
int Ans[1109][1109];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &f[i].x);
    f[i].y = i;
  }
  sort(f, f + n, cmp);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < f[i].x; j++)
      Ans[(i + j) % (n + 1)][f[i].y] = 1, m = max(m, (i + j) % (n + 1));
  }
  printf("%d\n", m + 1);
  for (int i = 0; i <= m; i++) {
    for (int j = 0; j < n; j++) printf("%d", Ans[i][j]);
    printf("\n");
  }
  return 0;
}
