#include <bits/stdc++.h>
using namespace std;
int n;
int r[111];
vector<int> w;
char ans[10101][111];
void zeroPrint() {
  printf("0\n");
  int cur[111];
  for (int i = 0; i < n; i++) cur[i] = r[i];
  int cnt = 0;
  while (true) {
    int gameCount = 0;
    ans[cnt][0] = '0';
    for (int i = 1; i < n; i++) {
      ans[cnt][i] = '0';
      if (gameCount < 4 && cur[i] > 0) {
        ans[cnt][i] = '1';
        gameCount++;
      }
    }
    if (gameCount == 0) break;
    ans[cnt][0] = '1';
    cnt++;
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) printf("%s\n", ans[i]);
  return;
}
bool getThis(int target) {
  int cur[111];
  for (int i = 0; i < n; i++) cur[i] = r[i];
  int cnt = 0;
  int overCount = 0;
  for (int i = 0; i < n; i++) overCount += cur[i] - target;
  if (overCount == 1) return false;
  priority_queue<pair<int, int> > bank;
  for (int i = 0; i < n; i++) {
    pair<int, int> tst;
    tst.first = cur[i];
    tst.second = i;
    bank.push(tst);
  }
  if (overCount % 2 == 1) {
    if (bank.size() < 3) return false;
    for (int i = 0; i < n; i++) ans[0][i] = '0';
    queue<pair<int, int> > wait;
    for (int i = 0; i < 3; i++) {
      pair<int, int> high = bank.top();
      bank.pop();
      int idx = high.second;
      int val = high.first;
      ans[0][idx] = '1';
      val--;
      if (val < target) return false;
      high.first = val;
      wait.push(high);
    }
    cnt = 1;
    while (!wait.empty()) {
      bank.push(wait.front());
      wait.pop();
    }
  }
  while (true) {
    queue<pair<int, int> > wait;
    for (int i = 0; i < n; i++) ans[cnt][i] = '0';
    pair<int, int> fst = bank.top();
    bank.pop();
    if (fst.first == target) break;
    fst.first--;
    ans[cnt][fst.second] = '1';
    wait.push(fst);
    if (bank.empty()) return false;
    pair<int, int> scd = bank.top();
    bank.pop();
    if (scd.first <= target) return false;
    scd.first--;
    ans[cnt][scd.second] = '1';
    wait.push(scd);
    cnt++;
    bank.push(wait.front());
    wait.pop();
    bank.push(wait.front());
    wait.pop();
  }
  printf("%d\n%d\n", target, cnt);
  for (int i = 0; i < cnt; i++) printf("%s\n", ans[i]);
  return true;
}
bool getThisZero(int target) {
  int cur[111];
  for (int i = 0; i < n; i++) cur[i] = r[i];
  int cnt = 0;
  priority_queue<pair<int, int> > bank;
  for (int i = 0; i < n; i++) {
    pair<int, int> tst;
    tst.first = cur[i];
    tst.second = i;
    bank.push(tst);
  }
  while (true) {
    queue<pair<int, int> > wait;
    for (int i = 0; i < n; i++) ans[cnt][i] = '0';
    pair<int, int> fst = bank.top();
    bank.pop();
    if (fst.first == target) break;
    fst.first--;
    ans[cnt][fst.second] = '1';
    wait.push(fst);
    pair<int, int> scd = bank.top();
    bank.pop();
    if (scd.first > 0) scd.first--;
    ans[cnt][scd.second] = '1';
    wait.push(scd);
    cnt++;
    bank.push(wait.front());
    wait.pop();
    bank.push(wait.front());
    wait.pop();
  }
  printf("%d\n%d\n", target, cnt);
  for (int i = 0; i < cnt; i++) printf("%s\n", ans[i]);
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int tmp;
    scanf("%d", &tmp);
    r[i] = tmp;
    w.push_back(tmp);
  }
  sort(w.begin(), w.end());
  if (n == 1) {
    printf("%d\n0\n", r[0]);
    return 0;
  }
  if (r[0] == 0) {
    zeroPrint();
    return 0;
  }
  for (int i = w[0]; i >= 0; i--) {
    bool ok = getThis(i);
    if (ok) return 0;
  }
  bool suck = getThisZero(0);
  return 0;
}
