#include <bits/stdc++.h>
using namespace std;
long long mo(const long long input, const long long ceil) {
  return input >= ceil ? input % ceil : input;
}
const long long mxN = 1e3;
long long n, ans[mxN + 1][mxN];
array<long long, 2> a[mxN];
void solve(long long tt) {
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i][0];
    a[i][1] = i;
  }
  sort(a, a + n, greater<array<long long, 2>>());
  for (long long i = 0; i < n; ++i) {
    for (long long j = 0; j < a[i][0]; ++j) {
      ans[(i + j) % (n + 1)][a[i][1]] = 1;
    }
  }
  cout << n + 1 << "\n";
  for (long long i = 0; i <= n; ++i) {
    for (long long j = 0; j < n; ++j) cout << ans[i][j];
    cout << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tt = 1;
  for (long long i = 0; i < tt; i++) solve(tt);
  cerr << "\n\n\nTime : "
       << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC << "ms\n";
  ;
  return 0;
}
