#include <bits/stdc++.h>
using namespace std;
string s[1009];
int A[1009];
int main() {
  int n;
  vector<pair<int, int> > v;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    s[1] += '0';
  }
  for (int i = 2; i <= n + 1; i++) s[i] = s[1];
  v.push_back({n + 1, 1});
  for (int i = 0; i < n; i++) {
    sort(v.begin(), v.end());
    int a = A[i + 1], b = n + 1 - A[i + 1];
    for (int j = 0; j < v.size() - 1; j++) {
      int l = v[j].second, r = l + v[j].first - 1;
      for (int x = l; x <= r; x++) {
        if (a > b)
          s[x][i] = '1', a--;
        else
          b--;
      }
    }
    int l = v.back().second, r = l + v.back().first - 1;
    v.pop_back();
    v.push_back({a, l});
    v.push_back({b, l + a});
    for (int j = l; a; j++)
      if (a) s[j][i] = '1', a--;
  }
  cout << n + 1 << endl;
  for (int i = 1; i <= n + 1; i++) cout << s[i] << endl;
}
