#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 1005;
int N;
int A[MX];
bool ans[MX][MX];
int block[MX];
int bs[MX];
int bc = 1;
queue<int> ab;
bool poss(int K, int cnt) {
  for (int i = 0; i < (bc); i++) {
    cnt -= max(0, bs[i] - K);
  }
  return cnt >= 0;
}
void assign(int p) {
  int bp[MX];
  for (int i = 0; i < (MX); i++) bp[i] = -1;
  int ns[MX];
  int op = A[p];
  bool found = false;
  for (int i = 0; i < (MX); i++) {
    if (!found) {
      if (bs[i] > 1) {
        ns[i] = max(bs[i] - A[p], 1);
        found = true;
      } else {
        ns[i] = bs[i];
        if (bs[i] == 1 && A[p] > 1) {
          ns[i] = 0;
        }
      }
    } else {
      ns[i] = max(bs[i] - A[p], 0);
    }
    A[p] -= bs[i] - ns[i];
  }
  if (A[p] > 0) {
    A[p] = op;
    for (int i = 0; i < (MX); i++) {
      ns[i] = bs[i];
      if (bs[i] == 1 && A[p] > 0) {
        ns[i] = 0;
        A[p]--;
      }
    }
  }
  for (int i = 0; i < (MX); i++) {
    if (bs[i] == ns[i]) continue;
    if (ns[i] == 0) {
      bp[i] = i;
    } else {
      bp[i] = bc;
      bc++;
    }
  }
  for (int i = 0; i < (N + 1); i++) {
    if (bs[block[i]] > ns[block[i]]) {
      if (bp[block[i]] == block[i]) {
        ans[p][i] = !ans[p][i];
        ns[block[i]]++;
      } else {
        bs[block[i]]--;
        ans[p][i] = !ans[p][i];
        block[i] = bp[block[i]];
        bs[block[i]]++;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int i = 0; i < (N); i++) {
    cin >> A[i];
  }
  for (int i = 0; i < (MX); i++) bs[i] = 0;
  for (int i = 0; i < (N); i++) block[i] = 0;
  for (int i = 0; i < (N + 1); i++)
    for (int j = 0; j < (N); j++) ans[j][i] = false;
  bs[0] = N + 1;
  for (int i = 1; i < (MX); i++) {
    ab.push(i);
  }
  for (int x = 0; x < (N); x++) {
    assign(x);
  }
  cout << N + 1 << nl;
  for (int j = 0; j < (N + 1); j++) {
    for (int i = 0; i < (N); i++) {
      cout << (ans[i][j] ? 1 : 0);
    }
    cout << nl;
  }
  return 0;
}
