A revolution took place on the Buka Island. New government replaced the old one. The new government includes n parties and each of them is entitled to some part of the island according to their contribution to the revolution. However, they can't divide the island.

The island can be conventionally represented as two rectangles a × b and c × d unit squares in size correspondingly. The rectangles are located close to each other. At that, one of the sides with the length of a and one of the sides with the length of c lie on one line. You can see this in more details on the picture.

<image>

The i-th party is entitled to a part of the island equal to xi unit squares. Every such part should fully cover several squares of the island (it is not allowed to cover the squares partially) and be a connected figure. A "connected figure" presupposes that from any square of this party one can move to any other square of the same party moving through edge-adjacent squares also belonging to that party.

Your task is to divide the island between parties.

Input

The first line contains 5 space-separated integers — a, b, c, d and n (1 ≤ a, b, c, d ≤ 50, b ≠ d, 1 ≤ n ≤ 26). The second line contains n space-separated numbers. The i-th of them is equal to number xi (1 ≤ xi ≤ a × b + c × d). It is guaranteed that <image>.

Output

If dividing the island between parties in the required manner is impossible, print "NO" (without the quotes). Otherwise, print "YES" (also without the quotes) and, starting from the next line, print max(b, d) lines each containing a + c characters. To mark what square should belong to what party, use lowercase Latin letters. For the party that is first in order in the input data, use "a", for the second one use "b" and so on. Use "." for the squares that belong to the sea. The first symbol of the second line of the output data should correspond to the square that belongs to the rectangle a × b. The last symbol of the second line should correspond to the square that belongs to the rectangle c × d.

If there are several solutions output any.

Examples

Input

3 4 2 2 3
5 8 3


Output

YES
aaabb
aabbb
cbb..
ccb..


Input

3 2 1 4 4
1 2 3 4


Output

YES
abbd
cccd
...d
...d

Difficulty: HARD
Tags: Constructive algorithms

Starter code:

Solutions:
def solve(x0, y0, dx, X):
	for (i, x) in enumerate(X):
		while x > 0:
			x -= 1
			m[y0][x0] = i
			x0 += dx
			if x == 0 and i == len(X) - 1:
				break
			if x0 == -1:
				y0 += 1
				x0 = 0
				dx *= -1
				if m[y0][x0] == -1:
					return False
			elif x0 == a + c:
				y0 += 1
				x0 = a + c - 1
				dx *= -1
				if m[y0][x0] == -1:
					return False
			elif m[y0][x0] == -1:
				y0 += 1
				x0 -= dx
				dx *= -1
	return True
(a, b, c, d, n) = map(int, input().split())
X = list(map(int, input().split()))
m = [[0] * (a + c) for _ in range(max(b, d))]
if b < d:
	for i in range(b, d):
		for j in range(a):
			m[i][j] = -1
else:
	for i in range(d, b):
		for j in range(a, a + c):
			m[i][j] = -1
if solve(a + c - 1, 0, -1, X) == False:
	solve(0, 0, 1, X)
print('YES')
for x in m:
	print(''.join([chr(c + 97) if c >= 0 else '.' for c in x]))


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 1000000007
EPS = 1e-06

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
(a, b, c, d, n) = value()
area = array()
ans = [['.' for i in range(a + c)] for j in range(max(b, d))]
rev = False
if d < b:
	(a, c) = (c, a)
	(b, d) = (d, b)
	rev = True
ind = 0
for j in range(a):
	for i in range(b):
		if area[ind] == 0:
			ind += 1
		if a % 2 == 0:
			if j % 2 == 0:
				ans[i][j] = ALPHA[ind]
			else:
				ans[b - i - 1][j] = ALPHA[ind]
		elif j % 2:
			ans[i][j] = ALPHA[ind]
		else:
			ans[b - i - 1][j] = ALPHA[ind]
		area[ind] -= 1
_j = -1
for j in range(a, a + c):
	_j += 1
	for i in range(d):
		if area[ind] == 0:
			ind += 1
		if _j % 2 == 0:
			ans[i][j] = ALPHA[ind]
		else:
			ans[d - i - 1][j] = ALPHA[ind]
		area[ind] -= 1
print('YES')
for i in ans:
	if rev:
		print(*i[::-1], sep='')
	else:
		print(*i, sep='')


import math
import sys
input = sys.stdin.readline
from collections import Counter, defaultdict, deque

def f(a, b, c, d, n, x):
	grid = [['.' for co in range(a + c)] for r in range(max(b, d))]
	alphnum = 97
	pos = 0
	if (a + 1) % 2:
		for co in range(a):
			if co % 2 == 0:
				r = 0
				while r < b:
					grid[r][co] = chr(alphnum)
					x[pos] -= 1
					if x[pos] == 0:
						pos += 1
						alphnum += 1
					r += 1
			else:
				r = b - 1
				while r > -1:
					grid[r][co] = chr(alphnum)
					x[pos] -= 1
					if x[pos] == 0:
						pos += 1
						alphnum += 1
					r -= 1
		for co in range(a, a + c):
			if co % 2 == 0:
				r = 0
				while r < d:
					grid[r][co] = chr(alphnum)
					x[pos] -= 1
					if x[pos] == 0:
						pos += 1
						alphnum += 1
					r += 1
			else:
				r = d - 1
				while r > -1:
					grid[r][co] = chr(alphnum)
					x[pos] -= 1
					if x[pos] == 0:
						pos += 1
						alphnum += 1
					r -= 1
	else:
		for co in range(a):
			if co % 2 == 1:
				r = 0
				while r < b:
					grid[r][co] = chr(alphnum)
					x[pos] -= 1
					if x[pos] == 0:
						pos += 1
						alphnum += 1
					r += 1
			else:
				r = b - 1
				while r > -1:
					grid[r][co] = chr(alphnum)
					x[pos] -= 1
					if x[pos] == 0:
						pos += 1
						alphnum += 1
					r -= 1
		for co in range(a, a + c):
			if co % 2 == 1:
				r = 0
				while r < d:
					grid[r][co] = chr(alphnum)
					x[pos] -= 1
					if x[pos] == 0:
						pos += 1
						alphnum += 1
					r += 1
			else:
				r = d - 1
				while r > -1:
					grid[r][co] = chr(alphnum)
					x[pos] -= 1
					if x[pos] == 0:
						pos += 1
						alphnum += 1
					r -= 1
	return grid
t = 1
result = []
for i in range(t):
	(a, b, c, d, n) = list(map(int, input().split()))
	x = list(map(int, input().split()))
	result.append(f(a, b, c, d, n, x))
for i in range(t):
	print('YES')
	for j in range(len(result[i])):
		print(''.join(result[i][j]))


import sys
from array import array

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
(a, b, c, d, n) = map(int, input().split())
party = list(map(int, input().split()))
island = [['.'] * (a + c) for _ in range(max(b, d))]
(i, j, ub, lb) = (b - 1 if a % 2 else 0, 0, 0, b)
delta = -1 if a % 2 else 1
pi = 0
while pi < n:
	island[i][j] = chr(97 + pi)
	party[pi] -= 1
	if party[pi] == 0:
		pi += 1
	if not ub <= i + delta < lb:
		j += 1
		if j == a:
			lb = d
		delta *= -1
	else:
		i += delta
print('YES')
for row in island:
	print(*row, sep='')


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def solve():
	(a, b, c, d, n) = read_ints()
	parties = read_ints()

	def parties_iterator():
		alphas = 'abcdefghijklmnopqrstuvwxyz'
		for (party, count) in zip(alphas, parties):
			for _ in range(count):
				yield party
	ps = parties_iterator()
	get_party = lambda : next(ps)
	island = [['.' for _ in range(a + c)] for _ in range(max(b, d))]
	for i in range(b - 1, -1, -1):
		if i % 2 == 0:
			for j in range(a):
				island[i][j] = get_party()
		else:
			for j in range(a):
				island[i][a - 1 - j] = get_party()
	for i in range(d):
		if i % 2 == 0:
			for j in range(c):
				island[i][a + j] = get_party()
		else:
			for j in range(c):
				island[i][a + c - 1 - j] = get_party()
	print('YES')
	for row in island:
		print(''.join(row))
solve()


(a, b, c, d, n) = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]
grid = [['o' for _ in range(a + c)] for _ in range(max(b, d))]
(e, f) = (0, 0)
dr = 1
if b > d:
	for i in range(d, b):
		for j in range(a, a + c):
			grid[i][j] = '.'
	if d % 2 == 1:
		(e, f) = (0, a + c - 1)
		dr = -1
elif d > b:
	for i in range(b, d):
		for j in range(0, a):
			grid[i][j] = '.'
	if b % 2 == 0:
		(e, f) = (0, a + c - 1)
		dr = -1
k = 0
for _ in range((a + c) * max(d, b)):
	if grid[e][f] != '.':
		grid[e][f] = chr(ord('a') + k)
		p[k] -= 1
		if p[k] == 0:
			k += 1
	f += dr
	if f == -1:
		(e, f) = (e + 1, 0)
		dr = 1
	if f == a + c:
		(e, f) = (e + 1, a + c - 1)
		dr = -1
print('YES')
for i in range(max(b, d)):
	print(''.join(grid[i]))


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=-10 ** 6, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=10 ** 6, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(200001)]
pp = [0] * 200001

def SieveOfEratosthenes(n=200000):
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
(a, b, c, d, n) = map(int, input().split())
(*arr,) = map(int, input().split())
print('YES')
cur_i = i = 0
grid = [['.' for i in range(a + c)] for j in range(max(b, d))]
if (min(b, d) ^ (d < b)) & 1:
	(cur_j, cur_d) = (0, 1)
else:
	(cur_j, cur_d) = (a + c - 1, -1)
while i < n:
	grid[cur_i][cur_j] = chr(97 + i)
	cur_j += cur_d
	if cur_i >= b and cur_j < a or (cur_i >= d and cur_j >= a) or cur_j < 0 or (cur_j >= a + c):
		cur_i += 1
		cur_j -= cur_d
		cur_d = -cur_d
	arr[i] -= 1
	if not arr[i]:
		i += 1
for i in grid:
	print(''.join(i))


(a, b, c, d, n) = map(int, input().split())
(*arr,) = map(int, input().split())
print('YES')
cur_i = i = 0
grid = [['.' for i in range(a + c)] for j in range(max(b, d))]
if (min(b, d) ^ (d < b)) & 1:
	(cur_j, cur_d) = (0, 1)
else:
	(cur_j, cur_d) = (a + c - 1, -1)
while i < n:
	grid[cur_i][cur_j] = chr(97 + i)
	cur_j += cur_d
	if cur_i >= b and cur_j < a or (cur_i >= d and cur_j >= a) or cur_j < 0 or (cur_j >= a + c):
		cur_i += 1
		cur_j -= cur_d
		cur_d = -cur_d
	arr[i] -= 1
	if not arr[i]:
		i += 1
for i in grid:
	print(''.join(i))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(*ele, end='\n')
(a, b, c, d, n) = L()
arr = L()
print('YES')
cur_i = i = 0
grid = [['.' for i in range(a + c)] for j in range(max(b, d))]
if (min(b, d) ^ (d < b)) & 1:
	(cur_j, cur_d) = (0, 1)
else:
	(cur_j, cur_d) = (a + c - 1, -1)
while i < n:
	grid[cur_i][cur_j] = chr(97 + i)
	cur_j += cur_d
	if cur_i >= b and cur_j < a or (cur_i >= d and cur_j >= a) or cur_j < 0 or (cur_j >= a + c):
		cur_i += 1
		cur_j -= cur_d
		cur_d = -cur_d
	arr[i] -= 1
	if not arr[i]:
		i += 1
for i in grid:
	print(''.join(i))
endtime = time.time()


import os, io
from sys import stdout
import collections
import math
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
from collections import Counter

def primes(n):
	sieve = [True] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def binomial_coefficient(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def powerOfK(k, max):
	if k == 1:
		return [1]
	if k == -1:
		return [-1, 1]
	result = []
	n = 1
	while n <= max:
		result.append(n)
		n *= k
	return result

def prefixSum(arr):
	for i in range(1, len(arr)):
		arr[i] = arr[i] + arr[i - 1]
	return arr

def divisors(n):
	i = 1
	result = []
	while i * i <= n:
		if n % i == 0:
			if n / i == i:
				result.append(i)
			else:
				result.append(i)
				result.append(n / i)
		i += 1
	return result

def kadane(a, size):
	max_so_far = 0
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def digitsSum(n):
	if n == 0:
		return 0
	r = 0
	while n > 0:
		r += n % 10
		n //= 10
	return r

def print_grid(grid):
	for line in grid:
		print(''.join(line))
(a, b, c, d, n) = list(map(int, input().split()))
letters = list(map(int, input().split()))
x = a + c
y = max(b, d)
grid = []
for i in range(y):
	grid.append(['_'] * x)
if d > b:
	for i in range(b, d):
		for j in range(0, a):
			grid[i][j] = '.'
elif d < b:
	for i in range(d, b):
		for j in range(a, a + c):
			grid[i][j] = '.'
if b < d:
	space = d - b
	if space % 2 == 0:
		r1 = range(a + c - 1, -1, -1)
		r2 = range(0, a + c)
	else:
		r1 = range(0, a + c)
		r2 = range(a + c - 1, -1, -1)
else:
	space = b - d
	if space % 2 == 0:
		r1 = range(0, a + c)
		r2 = range(a + c - 1, -1, -1)
	else:
		r1 = range(a + c - 1, -1, -1)
		r2 = range(0, a + c)
li = 0
lr = letters[li]
for i in range(y - 1, -1, -1):
	if (y - 1 - i) % 2 == 0:
		r = r1
	else:
		r = r2
	for j in r:
		if grid[i][j] == '.':
			continue
		grid[i][j] = chr(97 + li)
		lr -= 1
		if lr == 0:
			li += 1
			if li < len(letters):
				lr += letters[li]
			else:
				print('YES')
				print_grid(grid)
				exit()


import sys
input = sys.stdin.readline
l = input().split()
a = int(l[0])
b = int(l[1])
c = int(l[2])
d = int(l[3])
n = int(l[4])
l = [[0 for i in range(a + c)] for i in range(max(b, d))]
if b >= d:
	for i in range(min(b, d), max(b, d)):
		for j in range(a, a + c):
			l[i][j] = '.'
else:
	for i in range(min(b, d), max(b, d)):
		for j in range(a):
			l[i][j] = '.'
currx = 0
curry = 0
curr = 0
p = input().split()
li = [int(i) for i in p]
print('YES')
if b >= d:
	if d % 2 == 0:
		curr = 0
		for i in range(b):
			if i % 2 == 0:
				for j in range(a + c):
					if l[i][j] == '.':
						continue
					l[i][j] = curr
					li[curr] -= 1
					if li[curr] == 0:
						curr += 1
			else:
				for j in range(a + c - 1, -1, -1):
					if l[i][j] == '.':
						continue
					l[i][j] = curr
					li[curr] -= 1
					if li[curr] == 0:
						curr += 1
	else:
		curr = 0
		for i in range(b):
			if i % 2 == 1:
				for j in range(a + c):
					if l[i][j] == '.':
						continue
					l[i][j] = curr
					li[curr] -= 1
					if li[curr] == 0:
						curr += 1
			else:
				for j in range(a + c - 1, -1, -1):
					if l[i][j] == '.':
						continue
					l[i][j] = curr
					li[curr] -= 1
					if li[curr] == 0:
						curr += 1
elif b % 2 == 1:
	curr = 0
	for i in range(d):
		if i % 2 == 0:
			for j in range(a + c):
				if l[i][j] == '.':
					continue
				l[i][j] = curr
				li[curr] -= 1
				if li[curr] == 0:
					curr += 1
		else:
			for j in range(a + c - 1, -1, -1):
				if l[i][j] == '.':
					continue
				l[i][j] = curr
				li[curr] -= 1
				if li[curr] == 0:
					curr += 1
else:
	curr = 0
	for i in range(d):
		if i % 2 == 1:
			for j in range(a + c):
				if l[i][j] == '.':
					continue
				l[i][j] = curr
				li[curr] -= 1
				if li[curr] == 0:
					curr += 1
		else:
			for j in range(a + c - 1, -1, -1):
				if l[i][j] == '.':
					continue
				l[i][j] = curr
				li[curr] -= 1
				if li[curr] == 0:
					curr += 1
for i in l:
	for j in i:
		if j == '.':
			print('.', end='')
		else:
			print(chr(97 + j), end='')
	print()


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
pow2 = [1]
d = {}

def main():
	(a, b, c, d, n) = map(int, input().split())
	x = list(map(int, input().split()))
	ans = [['.' for i in range(a + c)] for j in range(max(b, d))]
	t = 0
	now = 0
	ind = 0
	if a % 2:
		t = 1
	for j in range(a + c):
		if j < a:
			if t == 0:
				for i in range(b):
					ans[i][j] = chr(ord('a') + now)
					x[ind] -= 1
					if x[ind] == 0:
						ind += 1
						now += 1
			else:
				for i in range(b - 1, -1, -1):
					ans[i][j] = chr(ord('a') + now)
					x[ind] -= 1
					if x[ind] == 0:
						ind += 1
						now += 1
		elif t == 0:
			for i in range(d):
				ans[i][j] = chr(ord('a') + now)
				x[ind] -= 1
				if x[ind] == 0:
					ind += 1
					now += 1
		else:
			for i in range(d - 1, -1, -1):
				ans[i][j] = chr(ord('a') + now)
				x[ind] -= 1
				if x[ind] == 0:
					ind += 1
					now += 1
		t ^= 1
	print('YES')
	for i in ans:
		for j in i:
			print(j, end='')
		print('')
	return
main()