#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int r[N], t[N], pos, OUT[N * N][N], n;
priority_queue<pair<int, int> > q;
bool is(int k, bool go, bool out) {
  int i, u, id, j;
  vector<pair<int, int> > v;
  pos = 0;
  while (!q.empty()) q.pop();
  for (i = 1; i <= n; ++i)
    if (r[i] - k > 0) q.push(make_pair(r[i] - k, i));
  if (go && q.size() < 5) return 0;
  if (go) {
    for (i = 0; i < 5; ++i) v.push_back(q.top()), q.pop();
    for (i = 0; i < 5; ++i) {
      --v[i].first;
      if (v[i].first > 0) q.push(v[i]);
      if (out) OUT[pos][v[i].second] = 1;
    }
    if (out) ++pos;
    v.clear();
  }
  while (q.size() > 1) {
    for (i = 0; i < 2; ++i) v.push_back(q.top()), q.pop();
    for (i = 0; i < 2; ++i) {
      --v[i].first;
      if (v[i].first > 0) q.push(v[i]);
      if (out) OUT[pos][v[i].second] = 1;
    }
    if (out) ++pos;
    v.clear();
  }
  if (out) {
    cout << k << endl;
    cout << pos << endl;
    for (i = 0; i < pos; ++i) {
      for (j = 1; j <= n; ++j) printf("%d", OUT[i][j]);
      cout << endl;
    }
    exit(0);
  }
  if (q.size() == 0) return 1;
  return 0;
}
int main() {
  int i, k, j, x, u, v, st = 1e9;
  cin >> n;
  for (i = 1; i <= n; ++i) scanf("%d", &r[i]), st = min(st, r[i]);
  for (k = st; k >= 1; --k) {
    if (is(k, 1, 0)) {
      is(k, 1, 1);
    }
    if (is(k, 0, 0)) {
      is(k, 0, 1);
    }
  }
  cout << 0 << endl;
  cout << (n - 1) * 100 << endl;
  for (i = 1; i < n; ++i) {
    for (j = 0; j < 100; ++j) {
      for (k = 1; k <= n; ++k) {
        if (k == i || k == i + 1)
          printf("1");
        else
          printf("0");
      }
      cout << endl;
    }
  }
}
