#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, a[1010];
vector<int> v;
vector<int> ans[1010];
void print() {
  cout << "Current state" << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < ans[i].size(); j++) cout << ans[i][j];
    cout << endl;
  }
}
void process(int k) {
  vector<int> a, b;
  for (int i = 0; i < v.size(); i++) {
    a.push_back(0);
    b.push_back(v[i]);
  }
  while (k) {
    int c = 0;
    for (int i = 0; i < v.size() && k; i++) {
      if (b[i] <= 1) continue;
      c++;
      a[i]++;
      b[i]--;
      k--;
    }
    if (c == 0) break;
  }
  int last = 0;
  for (int i = 0; i < v.size(); i++) {
    for (int j = last; j < last + a[i]; j++) {
      ans[j].push_back(1);
    }
    for (int j = last + a[i]; j < last + a[i] + b[i]; j++) {
      ans[j].push_back(0);
    }
    last += a[i] + b[i];
  }
  last = 0;
  for (int i = 0; i < v.size(); i++) {
    if (a[i] == 0 && b[i] > 0 && k) {
      ans[last + a[i]].back() = 1;
      k--;
      b[i]--;
      a[i]++;
    }
    last += a[i] + b[i];
  }
  last = 0;
  for (int i = 0; i < v.size(); i++) {
    if (b[i] > 0 && k) {
      b[i]--;
      a[i]++;
      ans[last + a[i]].back() = 1;
      k--;
    }
  }
  vector<int> tmp;
  for (int i = 0; i < v.size(); i++) {
    if (a[i]) tmp.push_back(a[i]);
    if (b[i]) tmp.push_back(b[i]);
  }
  v = tmp;
}
int res[1010][1010];
int main() {
  scanf("%d", &n);
  v.push_back(n + 1);
  vector<pair<int, int> > b;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    b.push_back(make_pair(-a[i], i));
  }
  sort(b.begin(), b.end());
  for (int i = 0; i < b.size(); i++) process(-b[i].first);
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < n; j++) {
      res[i][b[j].second] = ans[i][j];
    }
  }
  printf("%d\n", n + 1);
  for (int i = 0; i < n + 1; i++) {
    for (int j = 0; j < n; j++) printf("%d", res[i][j]);
    printf("\n");
  }
  return 0;
}
