#include <bits/stdc++.h>
using namespace std;
int a[105];
int n;
bool finished() {
  for (int i = 0; i < n; i++) {
    if (a[i] != a[0]) return false;
  }
  return true;
}
int main() {
  scanf("%d", &n);
  priority_queue<pair<int, int>> pq;
  string s = "";
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    pq.push({a[i], i});
    s += '0';
  }
  vector<string> out;
  while (!finished()) {
    auto p = pq.top();
    pq.pop();
    auto q = pq.top();
    pq.pop();
    string t = s;
    t[p.second] = '1';
    t[q.second] = '1';
    out.push_back(t);
    a[p.second] = max(0, a[p.second] - 1);
    a[q.second] = max(0, a[q.second] - 1);
    pq.push({a[p.second], p.second});
    pq.push({a[q.second], q.second});
    if (finished()) break;
    auto r = pq.top();
    if (r.first == p.first && r.second != p.second && r.second != q.second) {
      a[r.second]--;
      if (finished()) {
        out.back()[r.second] = '1';
        break;
      }
      a[r.second]++;
    }
  }
  printf("%d\n%d\n", a[0], (int)out.size());
  for (auto ss : out) {
    printf("%s\n", ss.c_str());
  }
  return 0;
}
