#include <bits/stdc++.h>
using namespace std;
const int N = 1e3, mod = 998244353;
int a[N + 2], n, ans[N + 2][N + 2];
int ha[N + 2];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n + 1; i++) ha[i] = 0;
  for (int i = 1; i <= n; i++) {
    bool fl = 0;
    for (int j = 1; j <= n + 1; j++)
      for (int k = j + 1; k <= n + 1; k++)
        if (ha[k] == ha[j]) {
          fl = 1;
          break;
        }
    if (!fl) {
      for (int j = 1; j <= a[i]; j++)
        ans[j][i] = 1, ha[j] = (1ll * ha[j] * 2 % mod + 1) % mod;
      for (int j = a[i] + 1; j <= n + 1; j++) ha[j] = 1ll * 2 * ha[j] % mod;
    } else {
      int tmp1, tmp2;
      for (int j = 1; j <= n + 1; j++)
        for (int k = j + 1; k <= n + 1; k++)
          if (ha[k] == ha[j]) {
            tmp1 = j, tmp2 = k;
            break;
          }
      int lll = a[i] - 1;
      for (int j = 1; j <= n + 1; j++)
        if (j != tmp1 && j != tmp2) {
          if (lll == 0) break;
          ans[j][i] = 1;
          ha[j] = (1ll * ha[j] * 2 % mod + 1) % mod;
          lll--;
          if (lll == 0) break;
        }
      for (int j = 1; j <= n + 1; j++)
        if (j != tmp1 && j != tmp2 && !ans[j][i]) ha[j] = 1ll * ha[j] * 2 % mod;
      ans[tmp1][i] = 1;
      ha[tmp1] = (1ll * ha[tmp1] * 2 % mod + 1) % mod;
      ha[tmp2] = 1ll * ha[tmp2] * 2 % mod;
    }
  }
  printf("%d\n", n + 1);
  for (int i = 1; i <= n + 1; i++) {
    for (int j = 1; j <= n; j++) printf("%d", ans[i][j]);
    puts("");
  }
}
