#include <bits/stdc++.h>
using namespace std;
int a[110];
char ans[10000][110];
int main() {
  int n;
  scanf("%d", &n);
  int imin = 10000;
  for (int i = 0; i < n; i++) scanf("%d", a + i), imin = min(imin, a[i]);
  for (;;) {
    priority_queue<pair<int, int>> pq;
    int sum = 0;
    for (int i = 0; i < n; i++)
      if (a[i] - imin != 0) pq.push({a[i] - imin, i}), sum += a[i] - imin;
    if (imin == 0) {
      int tms = 0;
      int st = 0;
      if (n & 1) {
        int imax = max(a[0], max(a[1], a[2]));
        while (imax--) {
          for (int i = 0; i < n; i++) ans[tms][i] = '0';
          ans[tms][0] = ans[tms][1] = ans[tms][2] = '1';
          ans[tms][n] = '\0';
          tms++;
        }
        st = 3;
      }
      for (int i = st; i < n; i += 2) {
        int imax = max(a[i], a[i + 1]);
        while (imax--) {
          for (int i = 0; i < n; i++) ans[tms][i] = '0';
          ans[tms][i] = ans[tms][i + 1] = '1';
          ans[tms][n] = '\0';
          tms++;
        }
      }
      printf("%d\n%d\n", imin, tms);
      for (int i = 0; i < tms; i++) puts(ans[i]);
      break;
    }
    if (pq.empty()) {
      printf("%d\n0", imin);
      break;
    }
    if (pq.size() > 1 && sum - pq.top().first >= pq.top().first) {
      int tms = 0;
      while (!pq.empty()) {
        if (pq.size() == 3 && pq.top().first == 1) {
          pair<int, int> a = pq.top();
          pq.pop();
          pair<int, int> b = pq.top();
          pq.pop();
          pair<int, int> c = pq.top();
          pq.pop();
          for (int i = 0; i < n; i++) ans[tms][i] = '0';
          ans[tms][a.second] = ans[tms][b.second] = ans[tms][c.second] = '1';
          ans[tms][n] = '\0';
          tms++;
          continue;
        }
        pair<int, int> a = pq.top();
        pq.pop();
        pair<int, int> b = pq.top();
        pq.pop();
        a.first--;
        b.first--;
        for (int i = 0; i < n; i++) ans[tms][i] = '0';
        ans[tms][a.second] = ans[tms][b.second] = '1';
        ans[tms][n] = '\0';
        if (a.first) pq.push(a);
        if (b.first) pq.push(b);
        tms++;
      }
      printf("%d\n%d\n", imin, tms);
      for (int i = 0; i < tms; i++) puts(ans[i]);
      break;
    }
    imin--;
  }
  return 0;
}
