#include <bits/stdc++.h>
using namespace std;
const int N = 1e3;
int n, a[N + 2], fid[N + 2], id[N + 2], ans[N + 2][N + 2];
bool cmp(int x, int y) { return a[x] > a[y]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  for (int i = 1; i <= n; i++) fid[id[i]] = i;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= a[id[i]]; j++)
      ans[((i + j - 1) > n + 1 ? i + j - 1 - n - 1 : i + j - 1)][i] = 1;
  printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; i++) {
    for (int j = 1; j <= n; j++) printf("%d", ans[i][fid[j]]);
    puts("");
  }
}
