#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> in(n);
  for (long long int i = 0; i < (long long int)(n); i++) cin >> in[i];
  vector<pair<string, long long int>> out;
  string res = "";
  for (long long int i = 0; i < (long long int)(n); i++) res += '0';
  out.push_back(make_pair(res, n + 1));
  for (long long int i = 0; i < (long long int)(n); i++) {
    long long int count = in[i];
    bool placed = false;
    string toAdd = "", toAdd2 = "";
    long long int c2 = 0;
    long long int c = 0;
    for (auto& temp : out) {
      if (placed) {
        long long int to = min(temp.second, count);
        if (to == temp.second) {
          temp.first[i] = '1';
        } else {
          temp.second -= to;
          toAdd2 = temp.first;
          toAdd2[i] = '1';
          c2 = to;
        }
        count -= to;
      } else if (temp.second == 1 && (count > 1 || out.size() == n + 1)) {
        temp.first[i] = '1';
        count--;
      } else if (temp.second > 1 && !placed) {
        long long int to = min(temp.second - 1, count);
        count -= to;
        c = to;
        temp.second -= to;
        toAdd = temp.first;
        toAdd[i] = '1';
        placed = true;
      }
      if (count == 0) break;
    }
    if (toAdd != "") out.push_back(make_pair(toAdd, c));
    if (toAdd2 != "") out.push_back(make_pair(toAdd2, c2));
  }
  long long int op = 0;
  for (auto temp : out) {
    if (temp.first.find('1') != string::npos) op++;
  }
  cout << op << endl;
  for (auto temp : out) {
    assert(temp.second == 1);
    if (temp.first.find('1') != string::npos) cout << temp.first << endl;
  }
}
