#include <bits/stdc++.h>
using namespace std;
template <typename T>
string to_string(const vector<T>& vc, int w) {
  if (vc.empty()) return "";
  if (w + 1 == vc.size()) return to_string(vc[w]);
  return to_string(vc[w]) + "," + to_string(vc, w + 1);
}
template <typename T>
string to_string(const vector<T>& vc) {
  return "{" + to_string(vc, 0) + "}";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
class DebugStream {
} LOG;
template <typename T>
DebugStream& operator<<(DebugStream& s, const T&) {
  return s;
}
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const int maxN = 1e5 + 9, maxV = 1e6 + 9, MOD = 1e9 + 7, SQ = 335, lg = 20,
          bs = 29;
int arr[maxN];
string subtr(vector<int>& arr, int amo) {
  assert(amo > 1);
  vector<int> inds(arr.size());
  iota(inds.begin(), inds.end(), 0);
  sort(inds.begin(), inds.end(), [&](int a, int b) { return arr[a] > arr[b]; });
  string ret(arr.size(), '0');
  for (int i = 0; i < amo; i++) {
    if (arr[inds[i]]) arr[inds[i]]--;
    ret[inds[i]] = '1';
  }
  return ret;
}
pair<vector<int>, vector<string>> transf(vector<int> arr) {
  vector<string> ret;
  while (vector<int>(arr.size(), arr[0]) != arr) {
    auto cr = subtr(arr, 2);
    ret.push_back(cr);
  }
  return make_pair(arr, ret);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  auto opt1 = transf(arr);
  string crr;
  if (n >= 3) crr = subtr(arr, 3);
  auto opt2 = transf(arr);
  if (n >= 3) opt2.second.push_back(crr);
  if (opt1.first[0] < opt2.first[0]) {
    swap(opt1, opt2);
  }
  cout << opt1.first[0] << '\n' << opt1.second.size() << '\n';
  ;
  for (auto el : opt1.second) cout << el << '\n';
}
