#include <bits/stdc++.h>
inline int getint() {
  int x = 0, p = 1;
  char c = getchar();
  while (c <= 32) c = getchar();
  if (c == 45) p = -p, c = getchar();
  while (c > 32) x = x * 10 + c - 48, c = getchar();
  return x * p;
}
using namespace std;
const int mod = 1e9 + 7;
inline void reduce(int &x) { x += x >> 31 & mod; }
inline int mul(int x, int y) { return 1ll * x * y % mod; }
const int N = 1005;
int n;
char res[N][N];
vector<pair<int, int> > a;
int main() {
  n = getint();
  for (int(i) = 0; (i) < (n); (i)++) a.emplace_back(getint(), i);
  sort(a.begin(), a.end());
  for (int(i) = 0; (i) < (n + 1); (i)++)
    for (int(j) = 0; (j) < (n); (j)++) res[i][j] = '0';
  for (int i = n - 1; i >= 0; i--) {
    for (int(j) = 0; (j) < (a[i].first); (j)++)
      res[(i - j + n + 1) % (n + 1)][a[i].second] = '1';
  }
  printf("%d\n", n + 1);
  for (int(i) = 0; (i) < (n + 1); (i)++) {
    for (int(j) = 0; (j) < (n); (j)++) putchar(res[i][j]);
    putchar('\n');
  }
  return 0;
}
