#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 105;
int n;
pair<int, int> a[MAX_N];
int b[MAX_N];
vector<string> resM;
bool check(int limit) {
  resM.clear();
  for (int i = 0; i < n; i++) {
    b[i] = a[i].first - limit;
  }
  for (int i = n - 1, j = n - 2; i >= 0; i--) {
    if (j == i) {
      j--;
    }
    while (b[i]) {
      while (j >= 0 && b[j] == 0) {
        j--;
      }
      if (j == -1) {
        break;
      } else {
        int cnt = min(b[i], b[j]);
        b[i] -= cnt;
        b[j] -= cnt;
        for (int k = 0; k < cnt; k++) {
          string t = string(n, '0');
          t[a[i].second] = '1';
          t[a[j].second] = '1';
          resM.push_back(t);
        }
      }
    }
    if (b[i]) {
      int j = 0;
      while (b[i]) {
        while (j < resM.size() && resM[j][a[i].second] == '1') {
          j++;
        }
        if (j == resM.size()) {
          break;
        }
        b[i]--;
        resM[j][a[i].second] = '1';
      }
    }
    if (b[i]) {
      if (limit != 0) {
        return false;
      } else {
        int j = i == n - 1 ? 0 : n - 1;
        while (b[i]) {
          string t = string(n, '0');
          t[a[i].second] = '1';
          t[a[j].second] = '1';
          resM.push_back(t);
          b[i]--;
        }
      }
    }
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    a[i] = make_pair(x, i);
  }
  sort(a, a + n);
  int ansR = 0;
  vector<string> ansM;
  for (int i = a[0].first; i >= 0; i--) {
    if (check(i)) {
      ansR = i;
      ansM = resM;
      break;
    }
  }
  printf("%d\n", ansR);
  printf("%d\n", (int)ansM.size());
  for (int i = 0; i < (int)ansM.size(); i++) {
    printf("%s\n", ansM[i].c_str());
  }
  return 0;
}
