#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:160777216")
using namespace std;
int i, j, n, m, k;
int cnt = 0;
pair<int, int> a[200];
int main() {
  cin >> n;
  int mn = 100;
  for (i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    mn = min(mn, a[i].first);
  }
  string tmp;
  for (i = 0; i < n; i++) tmp += "0";
  sort(a, a + n);
  for (int ans = mn; ans >= 0; ans--) {
    vector<pair<int, int> > v;
    for (j = 0; j < n; j++) {
      if (a[j].first - ans > 0) {
        v.push_back(make_pair(a[j].first - ans, a[j].second));
      }
    }
    int sz = v.size();
    if (v.size() == 0) {
      cout << ans << endl << 0 << endl;
      return 0;
    }
    int sum = 0;
    for (j = 0; j < v.size() - 1; j++) sum += v[j].first;
    if (sum < v[sz - 1].first) continue;
    sum += v[sz - 1].first;
    vector<string> answ;
    if (sum % 2 == 1) {
      string s = tmp;
      for (j = sz - 1; j >= sz - 3; j--) {
        s[v[j].second] = '1';
        v[j].first--;
      }
      answ.push_back(s);
    }
    while (v.size()) {
      sort(v.begin(), v.end());
      while (v.size() && v[0].first == 0) v.erase(v.begin());
      if (v.size() == 0) break;
      sz = v.size();
      string s = tmp;
      for (j = sz - 1; j >= sz - 2; j--) {
        s[v[j].second] = '1';
        v[j].first--;
      }
      answ.push_back(s);
    }
    cout << ans << endl;
    cout << answ.size() << endl;
    for (string s : answ) cout << s << endl;
    return 0;
  }
  cout << 0 << endl;
  vector<string> answ;
  for (i = 0; i < n; i++) {
    for (j = 0; j < 100; j++) {
      string s = tmp;
      s[i] = '1';
      if (i == n - 1)
        s[i - 1] = '1';
      else
        s[i + 1] = '1';
      answ.push_back(s);
    }
  }
  cout << answ.size() << endl;
  for (string s : answ) cout << s << endl;
  return 0;
}
