#include <bits/stdc++.h>
using namespace std;
template <typename T>
static ostream& operator<<(ostream& stream, const vector<T>& t);
template <typename T>
static istream& read(T, T, istream& = cin);
template <typename T>
static istream& operator>>(istream& stream, vector<T>& t) {
  return read((t).begin(), (t).end(), stream);
}
template <typename T>
static istream& read(T b, T e, istream& stream) {
  for (T it = b; it != e; ++it) stream >> *it;
  return stream;
}
template <typename T>
static void print(T x, string end = "\n") {
  cout << x << end;
}
template <typename T>
static ostream& print(T b, T e, string sep = " ", ostream& stream = cout) {
  for (T it = b; it != e; ++it) {
    stream << *it;
    if (it + 1 != e) stream << sep;
  }
  return stream;
}
template <typename T>
static void print(vector<T> arr, string sep = " ") {
  if (arr.empty()) {
    return;
  }
  print(arr.begin(), arr.end(), sep);
  cout << '\n';
}
void _() {
  int n;
  cin >> n;
  vector<int> arr(n);
  cin >> arr;
  vector<int> tmp(1, n + 1);
  vector<string> ans(n + 1, string(n, '0'));
  for (int j = 0; j <= n - 1; ++j) {
    int l = 0;
    vector<int> n_tmp;
    int ones = arr[j], zeros = n + 1 - arr[j];
    for (int x : tmp) {
      int take_zeros = min(zeros, x - (ones > 0));
      int take_ones = x - take_zeros;
      if (x == 1) {
        if (ones > zeros)
          take_ones = 1, take_zeros = 0;
        else
          take_ones = 0, take_zeros = 1;
      }
      zeros -= take_zeros;
      ones -= take_ones;
      for (int i = l; i <= l + take_zeros - 1; ++i) ans[i][j] = '0';
      l += take_zeros;
      for (int i = l; i <= l + take_ones - 1; ++i) ans[i][j] = '1';
      l += take_ones;
      if (take_zeros) n_tmp.push_back(take_zeros);
      if (take_ones) n_tmp.push_back(take_ones);
    }
    tmp = n_tmp;
  }
  print(n + 1);
  print(ans, "\n");
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(15);
  _();
}
