#include <bits/stdc++.h>
using namespace std;
const int MAXA = 26;
const int MAXN = 1e5 + 10;
int A;
int cnt[MAXA];
char s[MAXN];
void precalc() {}
bool read() {
  if (scanf("%d", &A) < 1) {
    return false;
  }
  for (int i = 0; i < (int)A; ++i) {
    assert(scanf("%d", &cnt[i]));
  }
  return true;
}
bool can_pal(const vector<int>& cnt) {
  int cnt_odd = 0;
  for (int c = 0; c < (int)A; ++c) {
    cnt_odd += (cnt[c] & 1);
  }
  return cnt_odd <= 1;
}
void solve() {
  int n = 0;
  for (int c = 0; c < (int)A; ++c) {
    n += cnt[c];
  }
  int best_len = n + 1;
  for (int len = 1; len <= n; ++len) {
    if (n % len != 0) {
      continue;
    }
    int blocks = n / len;
    vector<int> cur_cnt(A, 0);
    bool ok = true;
    for (int c = 0; c < (int)A; ++c) {
      if (cnt[c] % blocks != 0) {
        ok = false;
        break;
      }
      cur_cnt[c] = cnt[c] / blocks;
    }
    if (!ok) {
      continue;
    }
    if (blocks % 2 == 0) {
      best_len = min(best_len, len);
    }
    if (can_pal(cur_cnt)) {
      best_len = min(best_len, len);
    }
  }
  if (best_len == n + 1) {
    puts("0");
    n = 0;
    for (int c = 0; c < (int)A; ++c)
      for (int i = 0; i < (int)cnt[c]; ++i) s[n++] = 'a' + c;
    s[n] = 0;
    puts(s);
    return;
  }
  printf("%d\n", n / best_len);
  int blocks = n / best_len;
  vector<int> cur_cnt(A, 0);
  for (int c = 0; c < (int)A; ++c) {
    assert(cnt[c] % blocks == 0);
    cur_cnt[c] = cnt[c] / blocks;
  }
  if (blocks % 2 == 0) {
    n = 0;
    for (int b = 0; b < (int)blocks; ++b) {
      if (b & 1) {
        for (int c = 0; c < (int)A; ++c)
          for (int i = 0; i < (int)cur_cnt[c]; ++i) s[n++] = 'a' + c;
      } else {
        for (int c = ((int)A) - 1; c >= 0; --c)
          for (int i = 0; i < (int)cur_cnt[c]; ++i) s[n++] = 'a' + c;
      }
    }
    s[n] = 0;
  } else {
    for (int b = 0; b < (int)blocks; ++b) {
      int l = b * best_len;
      int r = l + best_len - 1;
      for (int c = 0; c < (int)A; ++c) {
        for (int i = 0; i < (int)cur_cnt[c] / 2; ++i) {
          s[l] = s[r] = 'a' + c;
          ++l;
          --r;
        }
        if (cur_cnt[c] & 1) {
          s[(l + r) / 2] = 'a' + c;
        }
      }
    }
  }
  puts(s);
}
int main() {
  while (read()) {
    solve();
  }
  return 0;
}
