#include <bits/stdc++.h>
using namespace std;
int N, r[105];
void trydo(int c) {
  int diffam[105];
  int totSum(0), maxsum(0);
  for (int i = (0); i < (N); i++) {
    if (r[i] < c) return;
    diffam[i] = r[i] - c;
    totSum += diffam[i];
    maxsum = max(maxsum, diffam[i]);
  }
  if (maxsum > totSum - maxsum && c != 0) return;
  vector<string> allAns;
  while (true) {
    pair<int, int> cDiff[105];
    for (int i = (0); i < (N); i++) {
      cDiff[i] = {diffam[i], i};
    }
    sort(cDiff, cDiff + N);
    reverse(cDiff, cDiff + N);
    if (cDiff[0].first == 0) break;
    if (cDiff[1].first == 0 && c != 0) return;
    if (cDiff[3].first == 0 && cDiff[0].first == 1 && cDiff[2].first == 1) {
      string cStr = "";
      for (int i = (0); i < (N); i++) {
        if (i == cDiff[0].second || i == cDiff[1].second ||
            i == cDiff[2].second) {
          diffam[i]--;
          diffam[i] = max(diffam[i], 0);
          cStr += '1';
        } else {
          cStr += '0';
        }
      }
      allAns.push_back(cStr);
    } else {
      string cStr = "";
      for (int i = (0); i < (N); i++) {
        if (i == cDiff[0].second || i == cDiff[1].second) {
          diffam[i]--;
          diffam[i] = max(diffam[i], 0);
          cStr += '1';
        } else {
          cStr += '0';
        }
      }
      allAns.push_back(cStr);
    }
  }
  printf("%d\n", c);
  printf("%d\n", allAns.size());
  for (int i = (0); i < (allAns.size()); i++) {
    printf("%s\n", allAns[i].c_str());
  }
  exit(0);
}
int main() {
  scanf("%d", &N);
  for (int i = (0); i < (N); i++) scanf("%d", &r[i]);
  for (int i = 100; i >= 0; i--) {
    trydo(i);
  }
  return 0;
}
