#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e3;
int n, ans[mxN + 1][mxN], b;
array<int, 2> a[mxN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i][0];
    a[i][1] = i;
  }
  sort(a, a + n, greater<array<int, 2>>());
  for (; b < n && a[b][0] >= b + 1; ++b)
    ;
  for (int i = 0; i <= b; ++i) {
    for (int j = 0; j < b; ++j) ans[i][a[j][1]] = j != i;
    for (int j = b; j < n; ++j) {
      if (a[j][0] > 1) {
        ans[i][a[j][1]] = 1;
        --a[j][0];
      }
    }
  }
  for (int i = b; i < n; ++i) {
    for (int j = 0; j < b; ++j) ans[i + 1][a[j][1]] = a[j][0] > i;
    ans[i + 1][a[i][1]] = 1;
  }
  cout << n + 1 << "\n";
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j < n; ++j) cout << ans[i][j];
    cout << "\n";
  }
}
