#include <bits/stdc++.h>
using namespace std;
const int maxn = 111;
struct Item {
  int x, id;
  bool operator<(Item b) const { return x < b.x; }
} a[maxn];
int b[maxn];
int n;
char s[maxn * maxn][maxn];
inline void check(int L) {
  int total = 0;
  int sz = 0;
  for (int i = 1; i <= n; i++) {
    a[i].x = b[i] - L, a[i].id = i;
    total += a[i].x;
  }
  int id1, id2, id3;
  if (total % 2 == 1) {
    if (n < 3) return;
    for (int i = 2; i <= n; i++)
      if (a[i].x > a[1].x) swap(a[i], a[1]);
    for (int i = 3; i <= n; i++)
      if (a[i].x > a[2].x) swap(a[i], a[2]);
    for (int i = 4; i <= n; i++)
      if (a[i].x > a[3].x) swap(a[i], a[3]);
    if (!a[1].x || !a[2].x || !a[3].x) return;
    sz++;
    for (int i = 1; i <= n; i++) s[sz][i] = '0';
    a[1].x--;
    a[2].x--;
    a[3].x--;
    s[sz][a[1].id] = '1';
    s[sz][a[2].id] = '1';
    s[sz][a[3].id] = '1';
    total -= 3;
  }
  while (total) {
    if (n < 2) return;
    for (int i = 2; i <= n; i++)
      if (a[i].x > a[1].x) swap(a[i], a[1]);
    for (int i = 3; i <= n; i++)
      if (a[i].x > a[2].x) swap(a[i], a[2]);
    if (!a[1].x || !a[2].x) return;
    sz++;
    for (int i = 1; i <= n; i++) s[sz][i] = '0';
    a[1].x--;
    a[2].x--;
    s[sz][a[1].id] = '1';
    s[sz][a[2].id] = '1';
    total -= 2;
  }
  cout << L << endl;
  cout << sz << endl;
  for (int i = 1; i <= sz; i++) {
    for (int j = 1; j <= n; j++) printf("%c", s[i][j]);
    puts("");
  }
  exit(0);
}
vector<int> c;
inline void Proceed() {
  bool found;
  int sz = 0;
  while (1) {
    found = 0;
    for (int i = 1; i <= n; i++) {
      if (b[i]) {
        found = 1;
        break;
      }
    }
    if (!found) break;
    sz++;
    for (int i = 1; i <= n; i++) s[sz][i] = '0';
    c.clear();
    for (int i = 1; i <= n; i++) {
      if (b[i]) {
        c.push_back(i);
        b[i]--;
        if ((int)c.size() == 5) break;
      }
    }
    if ((int)c.size() < 2) {
      if (c[0] == 1)
        c.push_back(2);
      else
        c.push_back(1);
    }
    for (int i = 0; i < (int)c.size(); i++) s[sz][c[i]] = '1';
  }
  cout << sz << endl;
  for (int i = 1; i <= sz; i++) {
    for (int j = 1; j <= n; j++) cout << s[i][j];
    puts("");
  }
}
int main() {
  cin >> n;
  int st = 111;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    st = min(st, b[i]);
  }
  for (int L = st; L > 0; L--) check(L);
  cout << 0 << endl;
  Proceed();
  return 0;
}
