#include <bits/stdc++.h>
using namespace std;
struct member {
  int x, n;
} a[110];
int n, t, ans[10010][110];
bool cmp(member x, member y) { return x.x < y.x; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].x), a[i].n = i;
  while (1) {
    sort(a + 1, a + 1 + n, cmp);
    if (a[1].x == a[n].x) break;
    t++;
    if (n >= 3 && a[n].x == a[n - 1].x && a[n - 1].x == a[n - 2].x &&
        a[n - 2].x != a[n - 3].x) {
      ans[t][a[n - 1].n] = ans[t][a[n].n] = ans[t][a[n - 2].n] = 1;
      a[n].x--;
      a[n - 1].x--;
      a[n - 2].x--;
    } else {
      ans[t][a[n - 1].n] = ans[t][a[n].n] = 1;
      a[n].x--;
      a[n - 1].x--;
      if (a[n - 1].x < 0) a[n - 1].x = 0;
    }
  }
  printf("%d\n", a[1].x);
  printf("%d\n", t);
  for (int i = 1; i <= t; i++) {
    for (int j = 1; j <= n; j++) printf("%d", ans[i][j]);
    printf("\n");
  }
  return 0;
}
