#include <bits/stdc++.h>
using namespace std;
namespace notsame {
int n;
int a[1010];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int grid[n + 1][n];
  int st = 0;
  int done = -1;
  for (int i = 0; i < n; i++) {
    if (st == done) {
      st++;
    }
    if (a[i] > (n + 1) / 2) {
      for (int j = 0; j < n + 1; j++) {
        if (j + a[i] < n + 1) {
          grid[(st + j) % (n + 1)][i] = 0;
        } else {
          grid[(st + j) % (n + 1)][i] = 1;
        }
      }
      if (i == 0) {
        done = (st + n + 1 - a[i]) % (n + 1);
      }
    } else {
      for (int j = 0; j < n + 1; j++) {
        if (j < a[i]) {
          grid[(st + j) % (n + 1)][i] = 1;
        } else {
          grid[(st + j) % (n + 1)][i] = 0;
        }
      }
      if (i == 0) {
        done = (st + a[i]) % (n + 1);
      }
    }
    st++;
  }
  cout << (n + 1) << endl;
  for (int i = 0; i < n + 1; i++) {
    for (int j = 0; j < n; j++) {
      cout << grid[i][j];
    }
    cout << endl;
  }
  return 0;
}
}  // namespace notsame
int main() {
  notsame::main();
  return 0;
}
