#include <bits/stdc++.h>
using namespace std;
bool ans[1003][1003], ok;
int n, a[1003], t, idx[1003];
bool cmp(int x, int y) { return a[x] > a[y]; }
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", a + i), idx[i] = i;
  sort(idx, idx + n, cmp);
  for (int i = 0; i < n; i++) {
    t = i;
    while (a[idx[i]]--) {
      ans[t][idx[i]] = 1;
      if (t == n) ok = 1;
      t = (t + 1) % (n + 1);
    }
  }
  cout << n + ok << endl;
  for (int i = 0; i < n + ok; i++) {
    for (int j = 0; j < n; j++) cout << ans[i][j];
    cout << endl;
  }
}
