#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> v(n);
  vector<vector<bool> > sol(n + 1, vector<bool>(n, 0));
  for (auto& i : v) cin >> i;
  int p = 0;
  for (int i = n; i >= 1; i--)
    for (int j = 0; j < n; j++)
      if (v[j] == i) {
        for (int k = 0; k < i; k++) sol[(p + k) % (n + 1)][j] = 1;
        p++;
      }
  cout << n + 1 << '\n';
  for (int i = 0; i < n + 1; i++) {
    for (int j = 0; j < n; j++) cout << sol[i][j];
    cout << '\n';
  }
}
