#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long xx = 0, flagg = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') {
    flagg = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    xx = xx * 10 + ch - '0';
    ch = getchar();
  }
  return xx * flagg;
}
void pus(long long xx, long long flagg) {
  if (xx < 0) {
    putchar('-');
    xx = -xx;
  }
  if (xx >= 10) pus(xx / 10, 0);
  putchar(xx % 10 + '0');
  if (flagg == 1) putchar(' ');
  if (flagg == 2) putchar('\n');
  return;
}
struct nyh {
  int x, id;
} o[1005];
bool cmp(nyh u, nyh v) { return u.x > v.x; }
int n, i, j, a[1005];
char s[1005][1005];
int main() {
  n = read();
  for (i = 1; i <= n; i++) {
    o[i].x = read();
    o[i].id = i;
  }
  sort(o + 1, o + n + 1, cmp);
  for (i = 1; i <= n + 1; i++)
    for (j = 1; j <= n; j++) s[i][j] = '0';
  for (i = 1; i <= n; i++)
    for (j = i; j < i + o[i].x; j++) s[(j - 1) % (n + 1) + 1][o[i].id] = '1';
  pus(n + 1, 2);
  for (i = 1; i <= n + 1; i++) printf("%s\n", s[i] + 1);
  return 0;
}
