#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int max0 = 70;
const int max1 = 500;
const int maxn = 50;
int n;
int a[maxn + 5];
int pre[maxn + 5][max0 + 5][max1 + 5];
int main() {
  scanf("%d", &n);
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) scanf("%d", a + i);
  sort(a, a + n);
  memset(pre, -1, sizeof pre);
  pre[0][0][0] = 0;
  for (int i = (0), i_end_ = (n); i < i_end_; ++i)
    for (int j = (0), j_end_ = (max0); j < j_end_; ++j)
      for (int k = (0), k_end_ = (max1); k < k_end_; ++k)
        if (~pre[i][j][k]) {
          if (k + a[i] - j >= 0)
            pre[i][j + 1][k + a[i] - j] = i,
                                     pre[i + 1][j + 1][k + a[i] - j] = i;
        }
  for (int i = (0), i_end_ = (max0); i < i_end_; ++i)
    if (~pre[n][i][0]) {
      int p = n, u = i, v = 0;
      vector<int> ret;
      while (u) {
        p = pre[p][u][v];
        ret.push_back(a[p]);
        --u;
        v += u - a[p];
      }
      reverse((ret).begin(), (ret).end());
      printf("%d\n", (int((ret).size())));
      static bool f[max0 + 5][max1 + 5];
      memset(f, 0, sizeof f);
      for (int j = (0), j_end_ = ((int((ret).size()))); j < j_end_; ++j) {
        static int pos[max0 + 5];
        int posn = 0;
        for (int k = (j + 1), k_end_ = ((int((ret).size()))); k < k_end_; ++k)
          pos[posn++] = k;
        sort(pos, pos + posn,
             [&](int first, int second) { return ret[first] < ret[second]; });
        for (int k = (0), k_end_ = (posn); k < k_end_; ++k)
          if (ret[j]) {
            --ret[j];
            f[j][pos[k]] = 1;
          } else
            f[pos[k]][j] = 1, --ret[pos[k]];
      }
      for (int j = (0), j_end_ = ((int((ret).size()))); j < j_end_; ++j) {
        for (int k = (0), k_end_ = ((int((ret).size()))); k < k_end_; ++k)
          printf("%d", f[j][k]);
        printf("\n");
      }
      return 0;
    }
  puts("=(");
  return 0;
}
