#include <bits/stdc++.h>
using namespace std;
long long n, ar[1005][1005];
set<pair<long long, long long> > sr[1005];
pair<long long, long long> pr[1005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pr[i].first;
    pr[i].second = i;
  }
  sort(pr, pr + n, greater<pair<long long, long long> >());
  sr[0].insert(make_pair(0, n));
  for (int i = 0; i < n; i++) {
    long long tr[2], idx = pr[i].second;
    tr[1] = pr[i].first, tr[0] = n + 1 - pr[i].first;
    for (auto x : sr[i]) {
      long long size_ = x.second - x.first + 1, k = 0;
      if (size_ == 1) {
        if (tr[0] < tr[1])
          ar[idx][x.first] = 1, tr[1]--;
        else
          ar[idx][x.first] = 0, tr[0]--;
        sr[i + 1].insert(make_pair(x.first, x.first));
      } else {
        long long k = 0, min_ = (tr[0] < tr[1]) ? 0 : 1;
        while (k < size_ / 2) {
          if (tr[min_]) {
            ar[idx][x.first + k] = min_, tr[min_]--;
            k++;
          } else
            break;
        }
        sr[i + 1].insert(make_pair(x.first, x.first + k - 1));
        sr[i + 1].insert(make_pair(x.first + k, x.second));
        while (k < size_) {
          if (tr[!min_]) {
            ar[idx][x.first + k] = !min_, tr[!min_]--;
            k++;
          }
        }
      }
    }
  }
  cout << n + 1 << "\n";
  for (int j = 0; j < n + 1; j++) {
    for (int i = 0; i < n; i++) cout << ar[i][j];
    cout << "\n";
  }
}
