#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > r(100);
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  int n, cur, ri, equalInRow, i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> ri;
    r[i] = make_pair(ri, i);
  }
  int cnt = 0;
  bool hasBeenUsed[10000 + 5][100 + 5];
  fill(&hasBeenUsed[0][0], &hasBeenUsed[10000 + 1][n + 1], false);
  for (;;) {
    sort(r.begin(), r.begin() + n, greater<pair<int, int> >());
    equalInRow = 0;
    for (i = 0, cur = r[i].first; i < n; i++) {
      if (cur == r[i].first)
        equalInRow++;
      else
        break;
    }
    if (equalInRow == n) break;
    if (equalInRow < 2) equalInRow = 2;
    equalInRow = min(equalInRow, 5 - ((equalInRow - 5) == 1));
    for (i = 0; i < equalInRow; i++) {
      hasBeenUsed[cnt][r[i].second] = true;
      r[i] = make_pair(max(r[i].first - 1, 0), r[i].second);
    }
    cnt++;
  }
  cout << cur << endl << cnt << endl;
  for (i = 0; i < cnt; i++) {
    for (j = 0; j < n; j++) {
      cout << hasBeenUsed[i][j];
    }
    cout << endl;
  }
  return 0;
}
