#include <bits/stdc++.h>
using namespace std;
int n;
int arr[111];
int cur[111];
int table[111][11111];
int num;
bool check(int x) {
  int sm = 0;
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    cur[i] = arr[i] - x;
    mx = max(cur[i], mx);
    sm += cur[i];
  }
  num = max((sm + 4) / 5, mx);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < num; j++) {
      table[i][j] = 0;
    }
  }
  int curr = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < cur[i]; j++) {
      table[i][curr] = 1;
      curr++;
      curr %= num;
    }
  }
  for (int i = 0; i < num; i++) {
    int ss = 0;
    for (int j = 1; j <= n; j++) {
      ss += table[j][i];
    }
    if (ss < 2 || ss > 5) {
      return false;
    }
  }
  return true;
}
string sll[11111];
int cnt = 0;
int main() {
  cin.sync_with_stdio(false);
  cin >> n;
  int mn = 1 << 20;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    mn = min(arr[i], mn);
  }
  int l = -1, r = mn + 1;
  while (r - l > 1) {
    int mid = (r + l) / 2;
    if (check(mid)) {
      l = mid;
    } else {
      r = mid;
    }
  }
  if (l == -1) {
    while (true) {
      string st = "";
      for (int i = 1; i <= n; i++) {
        st += '0';
      }
      st[0] = st[1] = '1';
      int ind = -1;
      for (int i = 1; i <= n; i++) {
        if (arr[i] > 0) {
          ind = i;
          break;
        }
      }
      if (ind == -1) {
        break;
      }
      arr[ind]--;
      st[ind - 1] = '1';
      sll[cnt++] = st;
    }
    cout << 0 << endl;
    cout << cnt << endl;
    for (int i = 0; i < cnt; i++) {
      cout << sll[i] << endl;
    }
    return 0;
  }
  check(l);
  cout << l << endl;
  cout << num << endl;
  for (int i = 0; i < num; i++) {
    for (int j = 1; j <= n; j++) {
      cout << table[j][i];
    }
    cout << endl;
  }
}
