#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
vector<int> ans[N];
int a[N], num[N], rest[N];
int n;
void dfs(int l, int r, int x) {
  int i;
  if (l == r) return;
  if (num[x] == a[x]) {
    for (int i = l; i <= r; i++) ans[i].push_back(0);
    dfs(l, r, x + 1);
    return;
  }
  if (num[x] + rest[x] - 1 >= a[x]) {
    for (i = l; i < r && num[x] < a[x]; i++) {
      ans[i].push_back(1);
      num[x]++;
    }
    for (int j = i; j <= r; j++) ans[j].push_back(0);
    rest[x] -= r - l + 1;
    dfs(l, i - 1, x + 1);
    dfs(i, r, x + 1);
  } else {
    for (i = l; i <= r; i++) ans[i].push_back(1);
    num[x] += r - l + 1;
    rest[x] -= r - l + 1;
    dfs(l, r, x + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) rest[i] = n + 1;
  dfs(1, n + 1, 1);
  for (int i = 1; i <= n + 1; i++) {
    if (ans[i].size() != n)
      for (int j = ans[i].size() + 1; j <= n; j++)
        if (num[j] != a[j])
          num[j]++, ans[i].push_back(1);
        else
          ans[i].push_back(0);
  }
  int tot = 0;
  for (int i = 1; i <= n + 1; i++) {
    int sum = 0;
    for (int j = 0; j < n; j++) sum += ans[i][j];
    if (sum != 0) tot++;
  }
  printf("%d\n", tot);
  for (int i = 1; i <= n + 1; i++) {
    int sum = 0;
    for (int j = 0; j < n; j++) sum += ans[i][j];
    if (sum != 0) {
      for (int j = 0; j < n; j++) printf("%d", ans[i][j]);
      printf("\n");
    }
  }
}
