#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, target = 0x3f3f3f3f, maxx = 0, id = 0;
  cin >> n;
  vector<int> v(n, 0), scores(101, 0);
  priority_queue<pair<int, int> > pq;
  vector<string> vs;
  string s = "";
  for (int i = 0; i < n; i++) {
    s += "0";
    cin >> v[i];
    pq.push({v[i], i});
    target = min(target, v[i]);
  }
  pair<int, int> p1, p2, p3{1, 0};
  while (1) {
    p1 = pq.top();
    pq.pop();
    p2 = pq.top();
    pq.pop();
    if (n >= 3 && p1.first == p2.first && pq.top().first == p2.first) {
      p3 = pq.top();
      pq.pop();
      if (pq.top().first == p3.first)
        pq.push(p3);
      else {
        s[p3.second] = '1';
        p3.first--;
        pq.push(p3);
      }
    }
    if (p1.first == target || p1.first == 0) break;
    s[p1.second] = '1';
    s[p2.second] = '1';
    vs.push_back(s);
    s[p1.second] = '0';
    s[p2.second] = '0';
    s[p3.second] = '0';
    p1.first--;
    p2.first--;
    target = min(target, p2.first);
    pq.push(p1);
    pq.push(p2);
  }
  cout << max(0, target) << endl;
  cout << (int)vs.size() << endl;
  for (int i = 0; i < vs.size(); i++) cout << vs[i] << endl;
  return 0;
}
