#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n;
int a[maxn], b[maxn];
vector<vector<int> > sol;
bool check(int t) {
  sol = vector<vector<int> >(0);
  set<pair<int, int> > g;
  for (int i = 0; i < n; ++i) b[i] = a[i];
  for (int i = 0; i < n; ++i) {
    if (a[i] > t) g.insert(pair<int, int>(a[i], i));
  }
  while (g.size() > 1) {
    pair<int, int> x = *g.rbegin();
    g.erase(x);
    if (x.first == 0) return true;
    pair<int, int> y = *g.rbegin();
    g.erase(y);
    pair<int, int> z;
    if (g.size()) z = *g.rbegin();
    if (g.size() == 1 and z.first == x.first) {
      g.erase(z);
      vector<int> v(n);
      for (int i = 0; i < n; ++i) {
        if (i == x.second or i == y.second or i == z.second)
          v[i] = 1;
        else
          v[i] = 0;
      }
      sol.push_back(v);
      --x.first;
      --y.first;
      --z.first;
      if (x.first > t or t == 0) g.insert(x);
      if (y.first > t or t == 0) g.insert(y);
      if (z.first > t or t == 0) g.insert(z);
    } else {
      vector<int> v(n);
      for (int i = 0; i < n; ++i) {
        if (i == x.second or i == y.second)
          v[i] = 1;
        else
          v[i] = 0;
      }
      sol.push_back(v);
      --x.first;
      --y.first;
      if (x.first > t or t == 0) g.insert(x);
      if (y.first > t or t == 0) g.insert(y);
    }
  }
  return g.empty();
}
int main() {
  cin >> n;
  int minim = 200;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    minim = min(minim, a[i]);
  }
  int j = minim;
  while (j >= 0) {
    if (check(j)) {
      cout << j << '\n';
      cout << sol.size() << '\n';
      for (int i = 0; i < sol.size(); ++i) {
        for (int k = 0; k < n; ++k) {
          cout << sol[i][k];
        }
        cout << '\n';
      }
      break;
    }
    --j;
  }
}
