#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
int a[N], b[N];
bool ans[N][N];
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  iota(b, b + n, 0);
  sort(b, b + n, [](int i, int j) { return a[i] > a[j]; });
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < a[b[i]]; j++) {
      ans[(i + j) % (n + 1)][b[i]] = 1;
    }
  }
  int m = n;
  for (int i = 0; i < n; i++) {
    if (ans[n][i]) {
      m++;
      break;
    }
  }
  printf("%d\n", m);
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      putchar(ans[i][j] + '0');
    }
    printf("\n");
  }
}
int main() {
  solve();
  return 0;
}
