#include <bits/stdc++.h>
using namespace std;
template <typename T>
T MAX(T a, T b) {
  return (a > b) ? a : b;
}
template <typename T>
T MIN(T a, T b) {
  return (a < b) ? a : b;
}
template <typename T>
void UMAX(T &a, T b) {
  a = (a > b ? a : b);
}
template <typename T>
void UMIN(T &a, T b) {
  a = (a < b ? a : b);
}
int readint() {
  char c = getchar();
  int ret = 0;
  while (!(c >= '0' && c <= '9')) c = getchar();
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return ret;
}
void putint(int v) {
  if (!v) {
    putchar('0');
    return;
  }
  if (v >= 10) putint(v / 10);
  putchar('0' + (v % 10));
}
int n, m, a[1005], sz[1005], fa[1005];
int got[1005][1005];
vector<int> sbs[1005][2];
int main() {
  int i, j, k, l;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  m = n + 1;
  sz[0] = m;
  fa[0] = 0;
  for (i = 1; i < m; ++i) {
    fa[i] = 0;
  }
  memset(got, -1, sizeof(got));
  for (i = 0; i < n; ++i) {
    int s1 = a[i], s0 = m - a[i];
    for (j = 0; j < m; ++j) {
      if (fa[j] == j && sz[j] > 1) {
        vector<int> vs;
        for (k = 0; k < m; ++k) {
          if (fa[k] == j) vs.push_back(k);
        }
        got[vs[0]][i] = 0;
        got[vs[1]][i] = 1;
        --s1;
        --s0;
        break;
      }
    }
    for (j = 0; j < m; ++j) {
      if (got[j][i] == -1) {
        if (s1) {
          --s1;
          got[j][i] = 1;
        } else {
          --s0;
          got[j][i] = 0;
        }
      }
    }
    for (j = 0; j < m; ++j) {
      sbs[j][0].clear();
      sbs[j][1].clear();
    }
    for (j = 0; j < m; ++j) {
      sbs[fa[j]][got[j][i]].push_back(j);
    }
    for (j = 0; j < m; ++j) {
      for (k = 0; k < 2; ++k) {
        int S = (int)sbs[j][k].size();
        if (!S) continue;
        sz[sbs[j][k][0]] = S;
        for (l = 0; l < S; ++l) fa[sbs[j][k][l]] = sbs[j][k][0];
      }
    }
  }
  printf("%d\n", m);
  for (i = 0; i < m; ++i) {
    for (j = 0; j < n; ++j) {
      printf("%d", got[i][j]);
    }
    printf("\n");
  }
  return 0;
}
