#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> t(n);
  for (int i = 0; i < n; ++i) cin >> t[i];
  vector<string> ans(n + 1, string(n, '0'));
  int akt = 0;
  for (int val = n; val >= 1; val--) {
    for (int i = 0; i < n; ++i) {
      if (val == t[i]) {
        for (int j = 0; j < t[i]; ++j) {
          ans[(akt + j) % (n + 1)][i] = '1';
        }
        akt++;
      }
    }
  }
  cout << n + 1 << "\n";
  for (auto i : ans) cout << i << "\n";
}
