#include <bits/stdc++.h>
const long long oo = (long long)1e18 + 1;
using namespace std;
int n;
int a[1010];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int roll_index = 0;
  for (int i = 1; i <= n; i++) cin >> a[i];
  vector<string> s(n + 1, string(n, '0'));
  for (int value = n; value >= 1; value--) {
    for (int i = 0; i < n; i++)
      if (a[i] == value) {
        for (int j = 0; j < value; j++) {
          s[(roll_index + j) % (n + 1)][i] = '1';
        }
        roll_index++;
      }
  }
  cout << n + 1 << "\n";
  for (int i = 0; i <= n; i++) cout << s[i] << "\n";
  return 0;
}
