#include <bits/stdc++.h>
template <typename T>
bool ckmax(T &x, T y) {
  return x < y ? x = y, true : false;
}
template <typename T>
bool ckmin(T &x, T y) {
  return x > y ? x = y, true : false;
}
using namespace std;
const long long inf = 100000000;
const double Pi = acos(-1);
const long long mod = 1e9 + 81;
const double eps = 1e-6;
inline long long fpow(long long a, long long b = mod - 2, long long p = mod) {
  a %= p;
  long long res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % p;
    a = 1ll * a * a % p;
    b >>= 1;
  }
  return res;
}
inline long long read() {
  char c = getchar();
  long long x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    write(-x);
    return;
  }
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writesp(long long x) { write(x), putchar(' '); }
inline void writeln(long long x) {
  write(x);
  putchar('\n');
}
const long long N = 1111;
long long n;
pair<long long, long long> a[N];
char s[N][N];
signed main() {
  n = read();
  for (long long i = (1), iE = (n); i <= iE; i++) a[i] = make_pair(read(), i);
  sort(a + 1, a + n + 1);
  for (long long i = (1), iE = (n); i <= iE; i++)
    for (long long j = (0), jE = (n); j <= jE; j++)
      s[(i + n - j) % (n + 1)][a[i].second - 1] = '0' + (j < a[i].first);
  writeln(n + 1);
  for (long long i = (0), iE = (n); i <= iE; i++) printf("%s\n", s[i]);
}
