#include <bits/stdc++.h>
using namespace std;
int n, x;
vector<int> v[1005], a[1005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    a[x].push_back(i);
    v[i].resize(n + 1, 0);
  }
  int st = -1;
  for (int i = n; i >= 1; --i) {
    for (int k : a[i]) {
      st++;
      int cur = st;
      for (int j = 1; j <= i; ++j) {
        v[k][cur] = 1;
        cur++;
        cur %= (n + 1);
      }
    }
  }
  cout << n + 1 << "\n";
  for (int i = 0; i < n + 1; ++i) {
    for (int j = 1; j <= n; ++j) cout << v[j][i];
    cout << "\n";
  }
  return 0;
}
