#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
template <typename _T>
inline void read(_T &f) {
  f = 0;
  _T fu = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') fu = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    f = (f << 3) + (f << 1) + (c & 15);
    c = getchar();
  }
  f *= fu;
}
template <typename T>
void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x < 10)
    putchar(x + 48);
  else
    print(x / 10), putchar(x % 10 + 48);
}
template <typename T>
void print(T x, char t) {
  print(x);
  putchar(t);
}
const int N = 1005;
int ans[N][N];
int a[N], p[N];
int n;
int main() {
  read(n);
  for (register int i = 1; i <= n; i++) read(a[i]), p[i] = i;
  sort(p + 1, p + n + 1, [&](int x, int y) { return a[x] > a[y]; });
  for (register int i = 1; i <= n; i++) {
    for (register int j = 0; j < a[p[i]]; j++) {
      ans[(i + j - 1) % (n + 1) + 1][p[i]] = 1;
    }
  }
  print(n + 1, '\n');
  for (register int i = 1; i <= n + 1; i++) {
    for (register int j = 1; j <= n; j++) {
      putchar(ans[i][j] + '0');
    }
    putchar('\n');
  }
  return 0;
}
