#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 7, mod = 1e9 + 7, MAXN = 1e6 + 7;
const double eps = 1e-9;
const long long inf = 1e18;
mt19937 rnd(time(0));
long long n;
long long a[maxn];
string ms[maxn];
void solve() {
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (long long i = 0; i < n + 1; ++i) {
    ms[i] = "";
    for (long long j = 0; j < n; ++j) ms[i] += "0";
  }
  for (long long i = 0; i < a[0]; ++i) {
    ms[i][0] = '1';
  }
  vector<pair<long long, long long> > cl;
  long long ptr = 2;
  for (long long i = 0; i <= n; ++i) {
    cl.emplace_back(ms[i][0] - '0', i);
  }
  sort(cl.begin(), cl.end());
  for (long long i = 1; i < n; ++i) {
    bool fl = false;
    for (long long j = 1; j <= n; ++j) {
      if (cl[j].first == cl[j - 1].first) {
        cl[j].first = ptr++;
        ms[cl[j].second][i] = '1';
        --a[i];
        for (auto &v : cl) {
          if (a[i] == 0) continue;
          if (v.second == cl[j].second || v.second == cl[j - 1].second)
            continue;
          if (cl[j - 1].first == v.first) {
            v.first = ptr - 1;
          }
          ms[v.second][i] = '1';
          --a[i];
        }
        fl = true;
        break;
      }
    }
    if (!fl) {
      for (long long j = 0; j < a[i]; ++j) ms[j][i] = '1';
    }
    sort(cl.begin(), cl.end());
  }
  cout << n + 1 << '\n';
  for (long long i = 0; i < n + 1; ++i) {
    for (long long j = 0; j < n; ++j) {
      cout << ms[i][j];
    }
    cout << '\n';
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  long long t = 1;
  for (long long i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
