#include <bits/stdc++.h>
using namespace std;
const int N = 102;
struct Node {
  int r, id;
  void scan(int i) {
    scanf("%d", &r);
    id = i;
  }
  bool operator<(const Node &t) const { return r > t.r; }
} a[N], b[N];
char ans[N * N][N];
int n, sum, cnt;
bool check(int x, int R) {
  if (b[x - 1].r <= R) return false;
  for (int i = 0; i < n; i++) ans[cnt][i] = '0';
  ans[cnt][n] = '\0';
  for (int i = 0; i < x; i++) {
    b[i].r--;
    ans[cnt][b[i].id] = '1';
  }
  for (int i = x - 1; i >= 0; i--) {
    for (int j = i + 1; j < n; j++) {
      if (b[j - 1].r < b[j].r) swap(b[j - 1], b[j]);
    }
  }
  cnt++;
  return true;
}
void solve0() {
  cnt = 0;
  for (int i = 1; i < n; i++) {
    for (int k = 0; k < 100; k++) {
      for (int j = 0; j < n; j++) ans[cnt][j] = '0';
      ans[cnt][i - 1] = ans[cnt][i] = '1';
      ans[cnt][n] = '\0';
      cnt++;
    }
  }
}
void prin(int R) {
  printf("%d\n%d\n", R, cnt);
  for (int i = 0; i < cnt; i++) {
    puts(ans[i]);
  }
}
void solve(int mx) {
  sort(a, a + n);
  for (int R = mx; R > 0; R--) {
    cnt = 0;
    for (int i = 0; i < n; i++) b[i] = a[i];
    int t, take = sum - n * R;
    if (take % 2 == 1) {
      if (take < 5 || n < 5) continue;
      if (!check(5, R)) continue;
      take -= 5;
    }
    t = take / 2;
    bool flag = 0;
    while (t--) {
      if (!check(2, R)) {
        flag = 1;
        break;
      }
    }
    if (flag) continue;
    prin(R);
    return;
  }
  solve0();
  prin(0);
}
int main() {
  int R = 100;
  scanf("%d", &n);
  for (int i = sum = 0; i < n; i++) {
    a[i].scan(i);
    R = min(R, a[i].r);
    sum += a[i].r;
  }
  solve(R);
  return 0;
}
