#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read() {
  T f = 0, x = 0;
  char c = getchar();
  while (!isdigit(c)) f = c == '-', c = getchar();
  while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
  return f ? -x : x;
}
namespace run {
const int N = 1e3 + 9;
bool ans[N][N];
int n;
pair<int, int> a[N];
int main() {
  n = read<int>();
  for (int i = 1; i <= n; i++) a[i] = pair<int, int>(-read<int>(), i);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = i; j < i - a[i].first; j++)
      ans[(j - 1) % (n + 1)][a[i].second] = 1;
  }
  int pos = n + 1;
  for (int i = 0; i <= n; i++) {
    int peg = 0;
    for (int j = 1; j <= n; j++)
      if (ans[i][j]) {
        peg = 1;
        break;
      }
    if (!peg) pos--;
  }
  printf("%d\n", pos);
  for (int i = 0; i <= n; i++) {
    int peg = 0;
    for (int j = 1; j <= n; j++)
      if (ans[i][j]) {
        peg = 1;
        break;
      }
    if (peg) {
      for (int j = 1; j <= n; j++) printf("%d", ans[i][j]);
      puts("");
    }
  }
  return 0;
}
}  // namespace run
int main() { return run::main(); }
