#include <bits/stdc++.h>
using namespace std;
long long n, r[107];
char rec[10007][107];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> r[i];
  int smme = r[0];
  bool cna = 1;
  for (int i = 1; i < n; i++)
    if (r[i] != smme) cna = 0;
  if (cna) return printf("%d\n0\n", r[0]), 0;
  int cnt = 0;
  while (1) {
    int big1 = -1, big2 = -1, bv1 = -1, bv2 = -1;
    for (int i = 0; i < n; i++)
      if (r[i] > bv1) {
        big2 = big1;
        bv2 = bv1;
        big1 = i;
        bv1 = r[i];
      } else if (r[i] > bv2) {
        big2 = i;
        bv2 = r[i];
      }
    if (r[big1] > 0) r[big1]--;
    if (r[big2] > 0) r[big2]--;
    for (int i = 0; i < n; i++)
      if (i == big1 || i == big2)
        rec[cnt][i] = '1';
      else
        rec[cnt][i] = '0';
    int same = r[0];
    if (bv1 == bv2) {
      int cnnt = 0;
      for (int i = 0; i < n; i++)
        if (r[i] == bv1) cnnt++;
      if (cnnt <= 3)
        for (int i = 0; i < n; i++)
          if (r[i] == bv1) {
            r[i]--;
            rec[cnt][i] = '1';
          }
    }
    bool can = 1;
    for (int i = 1; i < n; i++)
      if (r[i] != same) can = 0;
    cnt++;
    if (can) break;
  }
  printf("%d\n", r[0]);
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) printf("%s\n", rec[i]);
  return 0;
}
