#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using db = long double;
using row = vector<int>;
using ii = pair<int, int>;
const int N = 1e5 + 5, A = 6561, LG = 19, MOD = 1e9 + 7;
const int SQ = 450;
const long double EPS = 1e-7;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<ii> a(n);
  for (int i = 0; i < n; i++) cin >> a[i].first, a[i].second = i;
  vector<string> ans(n + 1, string(n, '0'));
  sort(a.rbegin(), a.rend());
  for (int i = 0; i < n; i++)
    for (int j = 0; j < a[i].first; j++)
      ans[(i + j) % (n + 1)][a[i].second] = '1';
  cout << n + 1 << '\n';
  for (int i = 0; i < n + 1; i++) cout << ans[i] << '\n';
  return 0;
}
