#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 5;
const int INF = 0x3f3f3f3f;
struct SNode {
  int r, id;
  SNode() {}
  SNode(int r, int id) : r(r), id(id) {}
  bool operator<(const SNode& e) const { return r > e.r; }
};
int N;
vector<string> Ans;
multiset<SNode> S;
int main() {
  ios::sync_with_stdio(false);
  S.clear();
  Ans.clear();
  cin >> N;
  for (int i = 0, r; i < N; i++) {
    cin >> r;
    S.insert(SNode(r, i));
  }
  while (S.begin()->r != S.rbegin()->r) {
    int sz = S.size(), num = 2;
    if (S.count(*S.begin()) == 3) num++;
    string buf(N, '0');
    vector<SNode> ar(num);
    for (int i = 0; i < num; i++) {
      SNode p = *S.begin();
      S.erase(S.begin());
      buf[p.id] = '1';
      p.r = max(p.r - 1, 0);
      ar[i] = p;
    }
    S.insert(ar.begin(), ar.end());
    Ans.push_back(buf);
  }
  cout << S.begin()->r << "\n" << Ans.size() << "\n";
  for (int i = 0; i < Ans.size(); i++) cout << Ans[i] << "\n";
  return 0;
}
