#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * w;
}
int n, nid[1005], c[1005][1005];
struct node {
  int id, v;
} a[1005];
bool cmp(node x, node y) { return x.v > y.v; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].v, a[i].id = i;
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) nid[a[i].id] = i;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= a[i].v; j++)
      c[(j + i - 1) > n + 1 ? j + i - 1 - n - 1 : j + i - 1][i] = 1;
  }
  cout << n + 1 << endl;
  for (int i = 1; i <= n + 1; i++) {
    for (int j = 1; j <= n; j++) cout << c[i][nid[j]];
    cout << endl;
  }
  return 0;
}
