#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long num = 0, neg = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    num = (num << 3) + (num << 1) + c - '0';
    c = getchar();
  }
  return num * neg;
}
struct node {
  int a, id;
} p[1010];
bool cmp1(node x, node y) { return x.a > y.a; }
int n, ans[1010][1010];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) p[i].a = read(), p[i].id = i;
  sort(p + 1, p + n + 1, cmp1);
  for (int i = 1; i <= n; i++)
    for (int j = i; p[i].a; p[i].a--, j = j % (n + 1) + 1) ans[j][p[i].id] = 1;
  printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; i++, printf("\n"))
    for (int j = 1; j <= n; j++) printf("%d", ans[i][j]);
  return 0;
}
