Ivan wants to make a necklace as a present to his beloved girl. A necklace is a cyclic sequence of beads of different colors. Ivan says that necklace is beautiful relative to the cut point between two adjacent beads, if the chain of beads remaining after this cut is a palindrome (reads the same forward and backward).

<image>

Ivan has beads of n colors. He wants to make a necklace, such that it's beautiful relative to as many cuts as possible. He certainly wants to use all the beads. Help him to make the most beautiful necklace.

Input

The first line of the input contains a single number n (1 ≤ n ≤ 26) — the number of colors of beads. The second line contains after n positive integers ai — the quantity of beads of i-th color. It is guaranteed that the sum of ai is at least 2 and does not exceed 100 000.

Output

In the first line print a single number — the maximum number of beautiful cuts that a necklace composed from given beads may have. In the second line print any example of such necklace.

Each color of the beads should be represented by the corresponding lowercase English letter (starting with a). As the necklace is cyclic, print it starting from any point.

Examples

Input

3
4 2 1


Output

1
abacaba

Input

1
4


Output

4
aaaa


Input

2
1 1


Output

0
ab

Note

In the first sample a necklace can have at most one beautiful cut. The example of such a necklace is shown on the picture.

In the second sample there is only one way to compose a necklace.

Difficulty: VERY_HARD
Tags: Mathematics

Constructive algorithms

Starter code:

Solutions:
import math
from functools import reduce
n = int(input())
odd = -1
beads = [int(x) for x in input().split()]
for i in range(n):
	if beads[i] % 2:
		if odd >= 0:
			print(0)
			print(''.join((chr(ord('a') + i) * beads[i] for i in range(n))))
			break
		else:
			odd = i
else:
	gcd = reduce(lambda x, y: math.gcd(x, y), beads)
	print(gcd)
	if odd >= 0:
		s = ''.join((chr(ord('a') + i) * (beads[i] // (2 * gcd)) for i in range(n) if i != odd))
		p = s + chr(ord('a') + odd) * (beads[odd] // gcd) + s[::-1]
		print(p * gcd)
	else:
		s = ''.join((chr(ord('a') + i) * (beads[i] // gcd) for i in range(n)))
		p = s + s[::-1]
		print(p * (gcd // 2))


from fractions import gcd
from functools import reduce
LETTERS = 'abcdefghijklmnopqrstuvwxyz'

def necklace_odd(a):
	oi = next((i for (i, ai) in enumerate(a) if ai % 2))
	o = a[oi]
	g = reduce(gcd, a)
	s = [LETTERS[i] * (a[i] // (2 * g)) for i in range(len(a)) if i != oi]
	return (g, (''.join(s) + LETTERS[oi] * (o // g) + ''.join(reversed(s))) * g)

def necklace_even(a):
	g = reduce(gcd, a) // 2
	s = [LETTERS[i] * (a[i] // (2 * g)) for i in range(len(a))]
	return (2 * g, (''.join(s) + ''.join(reversed(s))) * g)

def necklace(a):
	if len(a) == 1:
		return (a[0], LETTERS[0] * a[0])
	nodd = sum((ai % 2 for ai in a))
	if nodd > 1:
		return (0, ''.join((LETTERS[i] * a[i] for i in range(len(a)))))
	return (necklace_odd if nodd else necklace_even)(a)
n = int(input())
a = list(map(int, input().split()))
assert len(a) == n
(k, e) = necklace(a)
print(k)
print(e)


import sys, functools, fractions

def make_simple(ball_per_period, letters):
	output = []
	for (letter, count) in zip(letters, ball_per_period):
		output.append(letter * count)
	return ''.join(output)

def no_solution(balls, letters):
	print(0)
	print(make_simple(balls, letters))
	sys.exit(0)

def make_palindrom(ball_per_period, letters):
	palindrom = [None] * sum(ball_per_period)
	c = 0
	for (index, b) in enumerate(ball_per_period):
		if b % 2 == 1:
			if len(palindrom) % 2 == 0:
				return None
			center = len(palindrom) // 2
			if palindrom[center] is not None:
				return None
			palindrom[center] = letters[index]
		for _ in range(b // 2):
			palindrom[c] = letters[index]
			palindrom[len(palindrom) - c - 1] = letters[index]
			c += 1
	return ''.join(palindrom)

def main():
	n = int(input())
	balls = [int(i) for i in input().split()]
	letters = [chr(i + ord('a')) for i in range(26)]
	gcd = functools.reduce(fractions.gcd, balls)
	period = sum(balls) // gcd
	ball_per_period = [i // gcd for i in balls]
	palindrom = [0] * period
	odd_count = 0
	odd_index = None
	for (index, b) in enumerate(ball_per_period):
		if b % 2 == 1:
			odd_count += 1
			odd_index = index
	if gcd % 2 == 0:
		print(gcd)
		simple = make_simple(ball_per_period, letters)
		simple_rev = simple[::-1]
		for i in range(0, gcd, 2):
			print(simple, end='')
			print(simple_rev, end='')
		print()
		sys.exit(0)
	if odd_count <= 1:
		print(gcd)
		palindrom = make_palindrom(ball_per_period, letters)
		print(''.join(palindrom) * gcd)
	else:
		no_solution(balls, letters)
main()