Once Bob decided to lay a parquet floor in his living room. The living room is of size n × m metres. Bob had planks of three types: a planks 1 × 2 meters, b planks 2 × 1 meters, and c planks 2 × 2 meters. Help Bob find out, if it is possible to parquet the living room with such a set of planks, and if it is possible, find one of the possible ways to do so. Bob doesn't have to use all the planks.

Input

The first input line contains 5 space-separated integer numbers n, m, a, b, c (1 ≤ n, m ≤ 100, 0 ≤ a, b, c ≤ 104), n and m — the living room dimensions, a, b and c — amount of planks 1 × 2, 2 × 1 и 2 × 2 respectively. It's not allowed to turn the planks.

Output

If it is not possible to parquet the room with such a set of planks, output IMPOSSIBLE. Otherwise output one of the possible ways to parquet the room — output n lines with m lower-case Latin letters each. Two squares with common sides should contain the same letters, if they belong to one and the same plank, and different letters otherwise. Different planks can be marked with one and the same letter (see examples). If the answer is not unique, output any.

Examples

Input

2 6 2 2 1


Output

aabcca
aabdda


Input

1 1 100 100 100


Output

IMPOSSIBLE


Input

4 4 10 10 10


Output

aabb
aabb
bbaa
bbaa

Difficulty: HARD
Tags: Constructive algorithms

Combinatorics

Implementation

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
(n, m, a, b, c) = map(int, input().split())
mat = [0] * n
for i in range(n):
	mat[i] = [0] * m
n1 = [min(n * m // 4, c), min(m // 2 * n, a), min(n // 2 * m, b)]
p = ['c', 'a', 'b']
z = ['d', 'e', 'f', 'g']
z1 = ['m', 'n', 'u', 'o']
z2 = ['p', 'q', 'r', 'w']

def fill(h, w):
	if h <= 0 or w <= 0:
		return True
	i = 0
	j = 0
	for k in range(3):
		while n1[k] > 0:
			if k == 0:
				if i % 4 and j % 4:
					o = 3
				elif i % 4 and (not j % 4):
					o = 2
				elif not i % 4 and j % 4:
					o = 1
				else:
					o = 0
				mat[i][j] = mat[i + 1][j] = mat[i][j + 1] = mat[i + 1][j + 1] = z[o]
			if p[k] == 'a':
				if j % 4:
					o = 2
				else:
					o = 0
				mat[i][j] = mat[i][j + 1] = z1[o]
				mat[i + 1][j] = mat[i + 1][j + 1] = z1[o + 1]
			elif p[k] == 'b':
				if i % 4:
					o = 0
				else:
					o = 2
				mat[i][j] = mat[i + 1][j] = z2[o]
				mat[i][j + 1] = mat[i + 1][j + 1] = z2[o + 1]
			if k == 0:
				n1[k] -= 1
			else:
				n1[k] -= 2
			j += 2
			if j >= w:
				i += 2
				j = 0
				if i >= h:
					return True
	return False

def pmat():
	for i in range(n):
		for j in range(m):
			print(mat[i][j], end='')
		print('\n', end='')

def even(h, w):
	k1 = 0
	k2 = 0
	if n1[1] % 2 == 1:
		n1[1] -= 1
		k1 = 1
	if n1[2] % 2 == 1:
		n1[2] -= 1
		k2 = 1
	if fill(h, w):
		n1[1] += k1
		n1[2] += k2
		return True
	else:
		n1[1] += k1
		n1[2] += k2
		return False
if n * m % 2 == 0:
	if n % 2 == 0 and m % 2 == 0:
		if even(n, m):
			pmat()
		else:
			print('IMPOSSIBLE')
	elif n % 2 == 0 and m % 2 != 0:
		n1 = [min(n * m // 4, c), min(m // 2 * n, a), min(n // 2 * m, b)]
		p = ['c', 'a', 'b']
		f = 'b'
		if even(n, m - 1):
			for i in range(0, n, 2):
				mat[i][m - 1] = f
				mat[i + 1][m - 1] = f
				if f == 'a':
					f = 'b'
				else:
					f = 'a'
				n1[2] -= 1
			else:
				if n1[2] >= 0:
					pmat()
				else:
					print('IMPOSSIBLE')
		else:
			print('IMPOSSIBLE')
	else:
		n1 = [min(n * m // 4, c), min(n // 2 * m, b), min(m // 2 * n, a)]
		p = ['c', 'b', 'a']
		f = 'a'
		if even(n - 1, m):
			for i in range(0, m, 2):
				mat[n - 1][i] = f
				mat[n - 1][i + 1] = f
				if f == 'a':
					f = 'b'
				else:
					f = 'a'
				n1[2] -= 1
			else:
				if n1[2] >= 0:
					pmat()
				else:
					print('IMPOSSIBLE')
		else:
			print('IMPOSSIBLE')
elif n * m % 2 != 0:
	print('IMPOSSIBLE')


import sys
from array import array

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
(n, m, b, a, c) = map(int, input().split())

def ng():
	print('IMPOSSIBLE')
	exit()
if n * m & 1:
	ng()
ans = [['*'] * m for _ in range(n)]
if n % 2:
	s = ['y', 'z']
	for (i, j) in enumerate(range(0, m, 2)):
		ans[-1][j] = ans[-1][j + 1] = s[i & 1]
		b -= 1
if m % 2:
	s = ['y', 'z']
	for (i, j) in enumerate(range(0, n, 2)):
		ans[j][-1] = ans[j + 1][-1] = s[i & 1]
		a -= 1
s1 = [['a', 'b'], ['c', 'd']]
s2 = [['e', 'f'], ['g', 'h']]
for i in range(0, n - (n & 1), 2):
	for j in range(0, m - (m & 1), 2):
		if c:
			ans[i][j] = ans[i + 1][j] = ans[i][j + 1] = ans[i + 1][j + 1] = s1[0][0]
			c -= 1
		elif a >= 2:
			ans[i][j] = ans[i + 1][j] = s1[0][0]
			ans[i][j + 1] = ans[i + 1][j + 1] = s1[0][1]
			a -= 2
		else:
			ans[i][j] = ans[i][j + 1] = s1[0][0]
			ans[i + 1][j] = ans[i + 1][j + 1] = s1[0][1]
			b -= 2
		(s1[0], s1[1]) = (s1[1], s1[0])
	(s1, s2) = (s2, s1)
if a < 0 or b < 0:
	ng()
else:
	for row in ans:
		print(*row, sep='')


(n, m, a, b, c) = map(int, input().split())
ok = False
if n % 2 == 1 and m % 2 == 1:
	print('IMPOSSIBLE')
	exit()
if m % 2 == 1:
	(n, m, a, b, ok) = (m, n, b, a, True)
res = [['.' for i in range(m)] for i in range(n)]
for i in range(0, n - 1, 2):
	for j in range(0, m - 1, 2):
		x1 = chr(i % 4 + 4 * (j % 4) + ord('a'))
		x2 = chr(i % 4 + 4 * ((j + 1) % 4) + ord('a'))
		if c >= 1:
			res[i][j] = x1
			res[i + 1][j] = x1
			res[i][j + 1] = x1
			res[i + 1][j + 1] = x1
			c -= 1
		elif b >= 2:
			res[i][j] = x1
			res[i + 1][j] = x1
			res[i][j + 1] = x2
			res[i + 1][j + 1] = x2
			b -= 2
		elif a >= 2:
			res[i][j] = x1
			res[i + 1][j] = x2
			res[i][j + 1] = x1
			res[i + 1][j + 1] = x2
			a -= 2
		else:
			print('IMPOSSIBLE')
			exit()
if n % 2 == 1:
	for j in range(0, m, 2):
		i = n - 1
		x1 = chr(i % 4 + 4 * (j % 4) + ord('a'))
		x2 = chr(i % 4 + 4 * ((j + 1) % 4) + ord('a'))
		if a >= 1:
			res[i][j] = x1
			res[i][j + 1] = x1
			a -= 1
		else:
			print('IMPOSSIBLE')
			exit()
if ok:
	res = [[res[i][j] for i in range(n)] for j in range(m)]
print('\n'.join([''.join(it) for it in res]))


(n, m, a, b, c) = map(int, input().split())
swapped = False
if n % 2 == 1 and m % 2 == 1:
	print('IMPOSSIBLE')
	exit()
if m % 2 == 1:
	(n, m, a, b, swapped) = (m, n, b, a, True)
ans = [['.' for i in range(m)] for i in range(n)]
for i in range(0, n - 1, 2):
	for j in range(0, m - 1, 2):
		(l1, l2) = (chr(i % 4 + 4 * (j % 4) + ord('a')), chr(i % 4 + 4 * ((j + 1) % 4) + ord('a')))
		if c >= 1:
			ans[i][j] = l1
			ans[i + 1][j] = l1
			ans[i][j + 1] = l1
			ans[i + 1][j + 1] = l1
			c -= 1
		elif b >= 2:
			ans[i][j] = l1
			ans[i + 1][j] = l1
			ans[i][j + 1] = l2
			ans[i + 1][j + 1] = l2
			b -= 2
		elif a >= 2:
			ans[i][j] = l1
			ans[i + 1][j] = l2
			ans[i][j + 1] = l1
			ans[i + 1][j + 1] = l2
			a -= 2
		else:
			print('IMPOSSIBLE')
			exit()
if n % 2 == 1:
	for j in range(0, m, 2):
		i = n - 1
		(l1, l2) = (chr(i % 4 + 4 * (j % 4) + ord('a')), chr(i % 4 + 4 * ((j + 1) % 4) + ord('a')))
		if a >= 1:
			ans[i][j] = l1
			ans[i][j + 1] = l1
			a -= 1
		else:
			print('IMPOSSIBLE')
			exit()
if swapped:
	ans = [[ans[i][j] for i in range(n)] for j in range(m)]
print('\n'.join([''.join(x) for x in ans]))


from fractions import Fraction
import sys
sys.setrecursionlimit(1000 * 100)
(n, m, a, b, c) = tuple(map(int, input().split()))
err = 'IMPOSSIBLE'
if n % 2 == 1 and m % 2 == 1:
	print(err)
	sys.exit()
ret = [['.' for _ in range(m)] for _ in range(n)]

def col(i, j):
	return chr(ord('a') + 4 * (i % 4) + j % 4)
if n % 2 == 1:
	for i in range(0, m, 2):
		if a == 0:
			print(err)
			sys.exit()
		ret[n - 1][i] = ret[n - 1][i + 1] = col(n - 1, i)
		a -= 1
	n -= 1
if m % 2 == 1:
	for i in range(0, n, 2):
		if b == 0:
			print(err)
			sys.exit()
		ret[i][m - 1] = ret[i + 1][m - 1] = col(i, m - 1)
		b -= 1
	m -= 1
for i in range(0, n, 2):
	for j in range(0, m, 2):
		if a >= 2:
			a -= 2
			ret[i][j] = ret[i][j + 1] = col(i, j)
			ret[i + 1][j] = ret[i + 1][j + 1] = col(i + 1, j)
		elif b >= 2:
			b -= 2
			ret[i][j] = ret[i + 1][j] = col(i, j)
			ret[i][j + 1] = ret[i + 1][j + 1] = col(i, j + 1)
		elif c >= 1:
			c -= 1
			ret[i][j] = ret[i + 1][j] = ret[i][j + 1] = ret[i + 1][j + 1] = col(i, j)
		else:
			print(err)
			sys.exit()
for l in ret:
	print(''.join(l))


import sys

def fail():
	print('IMPOSSIBLE')
	sys.exit()
(n, m, a, b, c) = map(int, input().split())
if n * m % 2 == 1:
	fail()
if n * m > 2 * (a + b + 2 * c):
	fail()
g = [[' ' for c in range(m)] for r in range(n)]
if n % 2 == 1:
	if m > 2 * a:
		fail()
	letter = 'y'
	for i in range(0, m, 2):
		g[n - 1][i] = g[n - 1][i + 1] = letter
		letter = 'z' if letter == 'y' else 'y'
	a -= m // 2
if m % 2 == 1:
	if n > 2 * b:
		fail()
	letter = 'y'
	for r in range(0, n, 2):
		g[r][m - 1] = g[r + 1][m - 1] = letter
		letter = 'z' if letter == 'y' else 'y'
	b -= n // 2
a -= a % 2
b -= b % 2
if (n - n % 2) * (m - m % 2) > 2 * (a + b + 2 * c):
	fail()
letter_pairs = (('a', 'i'), ('x', 'q'))
for r in range(0, n - n % 2, 2):
	for c in range(0, m - m % 2, 2):
		letters = letter_pairs[(r // 2 + c // 2) % 2]
		if a > 0:
			g[r][c] = g[r][c + 1] = letters[0]
			g[r + 1][c] = g[r + 1][c + 1] = letters[1]
			a -= 2
		elif b > 0:
			g[r][c] = g[r + 1][c] = letters[0]
			g[r][c + 1] = g[r + 1][c + 1] = letters[1]
			b -= 2
		else:
			g[r][c] = g[r + 1][c] = g[r][c + 1] = g[r + 1][c + 1] = letters[0]
			c -= 1
print('\n'.join([''.join(g[r]) for r in range(n)]))