#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int id[N], w[N], a[N][N], n, nid[N];
int cmp(const int &a, const int &b) { return w[a] > w[b]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", w + i), id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  for (int i = 1; i <= n; i++) nid[id[i]] = i;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= w[id[i]]; j++)
      a[(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++, puts(""))
    for (int j = 1; j <= n; j++) putchar(a[i][nid[j]] + 48);
}
