#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3000500, INF = ~(1 << 31), MOD = 1e9 + 7, mod = 998244353;
const long long llINF = ~(1ll << 63);
int mp[1005][1005];
struct Node {
  int id, val;
} a[1005];
int main() {
  int mx = 0, n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].val);
    a[i].id = i;
    mx = max(mx, a[i].val + 1);
  }
  sort(a + 1, a + n + 1, [&](Node a, Node b) { return a.val > b.val; });
  int lst = a[1].val;
  for (int i = 1; i <= n; i++) {
    int now = a[i].id;
    for (int j = 1; j <= a[i].val; j++) {
      int p = (j + i - 2 + mx) % mx + 1;
      mp[now][p] = 1;
    }
  }
  cout << mx << endl;
  for (int j = 1; j <= mx; j++) {
    for (int i = 1; i <= n; i++) printf("%d", mp[i][j]);
    puts("");
  }
  return 0;
}
