#include <bits/stdc++.h>
using namespace std;
int n, ans[1010][1010];
pair<int, int> a[1010];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].first), a[i].second = i;
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    int j = i;
    while (a[i].first--) ans[j][a[i].second] = 1, j = (j + n) % (n + 1);
  }
  printf("%d\n", n + 1);
  for (int i = 0; i <= n; i++, puts(""))
    for (int j = 1; j <= n; j++) printf("%d", ans[i][j]);
}
