#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> init_set;
  for (int i = 0; i < n + 1; ++i) {
    init_set.push_back(i);
  }
  vector<vector<int>> sets;
  sets.push_back(init_set);
  vector<string> result(n + 1, string(n, '0'));
  for (int i = 0; i < n; ++i) {
    vector<vector<int>> new_sets;
    int k = -1;
    for (int j = 0; j < sets.size(); ++j) {
      if (sets[j].size() > 1) {
        k = j;
        break;
      }
    }
    if (k == -1) {
      assert(sets.size() == n + 1);
      for (int j = 0; j < a[i]; ++j) {
        result[j][i] = '1';
      }
      continue;
    }
    int cnt = ((a[i] < sets[k].size() - 1) ? (a[i]) : (sets[k].size() - 1));
    vector<int> part1(sets[k].begin(), sets[k].begin() + cnt),
        part2(sets[k].begin() + cnt, sets[k].end());
    a[i] -= cnt;
    for (int j : part1) {
      result[j][i] = '1';
    }
    assert(!part1.empty());
    assert(!part2.empty());
    new_sets.push_back(part1);
    new_sets.push_back(part2);
    sets.erase(sets.begin() + k);
    for (auto& s : sets) {
      int cnt = ((a[i] < s.size()) ? (a[i]) : (s.size()));
      vector<int> part1(s.begin(), s.begin() + cnt),
          part2(s.begin() + cnt, s.end());
      a[i] -= cnt;
      for (int j : part1) {
        result[j][i] = '1';
      }
      if (!part1.empty()) {
        new_sets.push_back(part1);
      }
      if (!part2.empty()) {
        new_sets.push_back(part2);
      }
    }
    assert(a[i] == 0);
    sets = new_sets;
  }
  assert(sets.size() == n + 1);
  for (int i = result.size() - 1; i > 0; --i) {
    string empty(n, '0');
    if (result[i] == empty) {
      result.erase(result.begin() + i);
    }
  }
  cout << result.size() << endl;
  for (string& s : result) {
    cout << s << endl;
  }
  return 0;
}
