#include <bits/stdc++.h>
using namespace std;
int n;
int a[111];
int dep;
char s[11111][111];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  dep = 0;
  while (1) {
    int mi = a[0];
    int ma1 = 0, ma2 = -1;
    for (int i = 1; i < n; i++) {
      mi = min(mi, a[i]);
      if (a[i] > a[ma1]) {
        ma2 = ma1;
        ma1 = i;
      } else if (ma2 == -1 || a[i] > a[ma2])
        ma2 = i;
    }
    int cnt = 0;
    for (int i = 0; i < n; i++)
      if (a[i] > mi) cnt++;
    if (!cnt) break;
    dep++;
    for (int i = 0; i < n; i++) s[dep][i] = '0';
    if (a[ma1] == mi + 1 && cnt == 3) {
      for (int i = 0; i < n; i++)
        if (a[i] == mi + 1) {
          s[dep][i] = '1';
          a[i]--;
        }
      break;
    } else {
      if (a[ma1]) a[ma1]--;
      s[dep][ma1] = '1';
      if (a[ma2]) a[ma2]--;
      s[dep][ma2] = '1';
    }
  }
  printf("%d\n%d\n", a[0], dep);
  for (int i = 1; i <= dep; i++) printf("%s\n", s[i]);
  return 0;
}
