#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x;
}
const int N = 1010;
struct node {
  int a, b;
} a[N];
int res[N][N], idx[N];
int main() {
  int n = read();
  for (int i = 1; i <= n; i++) a[i] = node{read(), i};
  sort(a + 1, a + n + 1, [&](node a, node b) { return a.a > b.a; });
  for (int i = 1; i <= n; i++) idx[a[i].b] = i;
  for (int i = 1; i <= n; i++) {
    int x = n - i + 3;
    for (int j = 1; j <= a[i].a; j++) {
      x--;
      if (!x) x = n + 1;
      res[x][i] = 1;
    }
  }
  cout << n + 1 << endl;
  for (int i = 1; i <= n + 1; i++, putchar('\n'))
    for (int j = 1; j <= n; j++) printf("%d", res[i][idx[j]]);
  return 0;
}
