In the army, it isn't easy to form a group of soldiers that will be effective on the battlefield. The communication is crucial and thus no two soldiers should share a name (what would happen if they got an order that Bob is a scouter, if there are two Bobs?).

A group of soldiers is effective if and only if their names are different. For example, a group (John, Bob, Limak) would be effective, while groups (Gary, Bob, Gary) and (Alice, Alice) wouldn't.

You are a spy in the enemy's camp. You noticed n soldiers standing in a row, numbered 1 through n. The general wants to choose a group of k consecutive soldiers. For every k consecutive soldiers, the general wrote down whether they would be an effective group or not.

You managed to steal the general's notes, with n - k + 1 strings s_1, s_2, ..., s_{n} - k + 1, each either "YES" or "NO".   The string s_1 describes a group of soldiers 1 through k ("YES" if the group is effective, and "NO" otherwise).  The string s_2 describes a group of soldiers 2 through k + 1.  And so on, till the string s_{n} - k + 1 that describes a group of soldiers n - k + 1 through n. 

Your task is to find possible names of n soldiers. Names should match the stolen notes. Each name should be a string that consists of between 1 and 10 English letters, inclusive. The first letter should be uppercase, and all other letters should be lowercase. Names don't have to be existing names — it's allowed to print "Xyzzzdj" or "T" for example.

Find and print any solution. It can be proved that there always exists at least one solution.


-----Input-----

The first line of the input contains two integers n and k (2 ≤ k ≤ n ≤ 50) — the number of soldiers and the size of a group respectively.

The second line contains n - k + 1 strings s_1, s_2, ..., s_{n} - k + 1. The string s_{i} is "YES" if the group of soldiers i through i + k - 1 is effective, and "NO" otherwise.


-----Output-----

Find any solution satisfying all given conditions. In one line print n space-separated strings, denoting possible names of soldiers in the order. The first letter of each name should be uppercase, while the other letters should be lowercase. Each name should contain English letters only and has length from 1 to 10.

If there are multiple valid solutions, print any of them.


-----Examples-----
Input
8 3
NO NO YES YES YES NO

Output
Adam Bob Bob Cpqepqwer Limak Adam Bob Adam
Input
9 8
YES NO

Output
R Q Ccccccccc Ccocc Ccc So Strong Samples Ccc
Input
3 2
NO NO

Output
Na Na Na


-----Note-----

In the first sample, there are 8 soldiers. For every 3 consecutive ones we know whether they would be an effective group. Let's analyze the provided sample output:  First three soldiers (i.e. Adam, Bob, Bob) wouldn't be an effective group because there are two Bobs. Indeed, the string s_1 is "NO".  Soldiers 2 through 4 (Bob, Bob, Cpqepqwer) wouldn't be effective either, and the string s_2 is "NO".  Soldiers 3 through 5 (Bob, Cpqepqwer, Limak) would be effective, and the string s_3 is "YES".  ...,  Soldiers 6 through 8 (Adam, Bob, Adam) wouldn't be effective, and the string s_6 is "NO".

Source: codeforces | Difficulty: MEDIUM
Tags: Greedy algorithms

Constructive algorithms


Solutions:
import sys
import math
from collections import Counter
from operator import itemgetter
import queue

def IO():
	sys.stdin = open('pyinput.txt', 'r')
	sys.stdout = open('pyoutput.txt', 'w')

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

def LCM(a, b):
	return a * (b // GCD(a, b))

def scan(TYPE_1, TYPE_2=0):
	if TYPE_1 == int:
		return map(int, sys.stdin.readline().strip().split())
	elif TYPE_1 == float:
		return map(float, sys.stdin.readline().strip().split())
	elif TYPE_1 == list and TYPE_2 == float:
		return list(map(float, sys.stdin.readline().strip().split()))
	elif TYPE_1 == list and TYPE_2 == int:
		return list(map(int, sys.stdin.readline().strip().split()))
	elif TYPE_1 == str:
		return sys.stdin.readline().strip()
	else:
		print('ERROR!!!!')

def main():
	s = []
	for i in range(65, 91):
		s.append(chr(i))
	for i in range(97, 123):
		s.append('A' + chr(i))
	(n, k) = scan(int)
	a = scan(str).split()
	ans = []
	idx = 0
	for i in range(k - 1):
		ans.append(s[idx])
		idx += 1
	for i in range(n - k + 1):
		if a[i] == 'NO':
			ans.append(ans[-k + 1])
		else:
			ans.append(s[idx])
			idx += 1
	print(*ans)
main()


(n, k) = map(int, input().split())
a = input().split()
l = []
for i in range(n):
	if i < 26:
		l.append(chr(i + 65))
	else:
		l.append('A' + chr(i - 26 + 97))
for i in range(n - k + 1):
	if a[i] == 'NO':
		l[i + k - 1] = l[i]
print(*l)


(n, k) = map(int, input().split())
answers = input().split()
names = []
army = []
for i in range(26):
	names.append('Aa' + chr(ord('a') + i))
for i in range(24):
	names.append('Ab' + chr(ord('a') + i))
for i in range(n - k + 1):
	if answers[i] == 'NO':
		names[i + k - 1] = names[i]
names = names[:n]
print(' '.join(names))


name = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Aa', 'Ba', 'Ca', 'Da', 'Ea', 'Fa', 'Ga', 'Ha', 'Ia', 'Ja', 'Ka', 'La', 'Ma', 'Na', 'Oa', 'Pa', 'Qa', 'Ra', 'Sa', 'Ta', 'Ua', 'Va', 'Wa', 'Xa', 'Ya', 'Za']
(n, k) = map(int, input().split())
a = list(map(str, input().split()))
l = [name[i] for i in range(k - 1)]
ans = [name[i] for i in range(k - 1)]
j = k - 1
o = k - 1
for i in range(n - k + 1):
	x = l.pop(0)
	l.append(name[o])
	o += 1
	if a[i] == 'YES':
		ans.append(name[j])
		j += 1
	else:
		ans.append(ans[len(ans) - k + 1])
print(*ans)


a = input().split(' ')
b = input().split(' ')
n = int(a[0])
k = int(a[1])

def gen_name(i):
	name = ''
	offset = ord('A')
	while i > 0:
		name += chr(i % 26 + offset)
		offset = ord('a')
		i //= 26
	if name == '':
		name = 'A'
	return name
ans = [gen_name(i) for i in range(n)]
for i in range(n - k + 1):
	if b[i] == 'NO':
		ans[i + k - 1] = ans[i]
print(' '.join(ans))


names = [chr(ord('A') + i) for i in range(26)]
names += ['A' + chr(ord('a') + i) for i in range(26)]
(n, k) = list(map(int, input().split()))
a = input().split()
for (i, a_i) in enumerate(a):
	if a_i == 'NO':
		names[i + k - 1] = names[i]
print(' '.join(names[:n]))


import sys, queue
try:
	import dev_act_ffc429465ab634
	DEV = True
except:
	DEV = False

def log(*s):
	if DEV:
		print('LOG', *s)

class EJudge:

	def __init__(self, problem='default', reclim=1 << 30):
		self.problem = problem
		sys.setrecursionlimit(reclim)

	def use_files(self, infile='', outfile=''):
		if infile != '':
			self.infile = open(infile)
			sys.stdin = self.infile
		if infile != '':
			self.outfile = open(outfile, 'w')
			sys.stdout = self.outfile

	def use_bacs_files(self):
		self.use_files(self.problem + '.in', self.problem + '.out')

	def get_tl(self):
		while True:
			pass

	def get_ml(self):
		tmp = [[[5] * 100000 for _ in range(1000)]]
		while True:
			tmp.append([[5] * 100000 for _ in range(1000)])

	def get_re(self):
		s = (0,)[8]

	def get_wa(self, wstr='blablalblah'):
		for _ in range(3):
			print(wstr)
		return

class IntReader:

	def __init__(self):
		self.ost = queue.Queue()

	def get(self):
		return int(self.sget())

	def sget(self):
		if self.ost.empty():
			for el in input().split():
				self.ost.put(el)
		return self.ost.get()

	def release(self):
		res = []
		while not self.ost.empty():
			res.append(self.ost.get())
		return res

def tokenized(s):
	word = []
	for ch in s.strip():
		if ch == ' ':
			if word:
				yield ''.join(word)
				word = []
		elif 'a' <= ch <= 'z' or 'A' <= ch <= 'Z' or '0' <= ch <= '9':
			word.append(ch)
		else:
			if word:
				yield ''.join(word)
				word = []
			yield ch
	if word:
		yield ''.join(word)
		word = []
ej = EJudge()
int_reader = IntReader()
fmap = lambda f, *l: list(map(f, *l))
parse_int = lambda : fmap(int, input().split())
(n, k) = parse_int()
seq = fmap(lambda x: x == 'YES', input().split())
names = [chr(ord('A') + i) for i in range(25)] + ['S' + chr(ord('a') + i) for i in range(25)]
names = names[:n]
for i in range(len(seq)):
	if not seq[i]:
		names[i + k - 1] = names[i]
print(' '.join(names))


(n, k) = map(int, input().split())
s = [i == 'YES' for i in input().split()]
r = []
name = 'Aa'

def nextName():
	nonlocal name
	if name[-1] == 'z':
		name = name + 'a'
	else:
		name = name[:-1] + chr(ord(name[-1]) + 1)
	return name
for i in range(k - 1):
	r.append(nextName())
for i in range(n - k + 1):
	r.append(nextName() if s[i] else r[i])
print(*r)


names = [chr(i + 65) + chr(j + 97) for i in range(26) for j in range(26)]
(n, m) = map(int, input().split())
ans = names[:m - 1]
j = m - 1
k = 0
for i in input().split():
	if i == 'YES':
		ans.append(names[j])
		j += 1
	else:
		ans.append(ans[k])
	k += 1
print(' '.join(ans))


(n, k) = list(map(int, input().split()))
s = list(input().split())

def generate_name(n):
	s = ''
	for i in range(10):
		if n == 0:
			break
		for j in range(26):
			n -= 1
			if n == 0:
				s += chr(ord('A') + j)
				return s.title()
		s += 'Z'
	return s.title()
names = []
t = 1
for i in range(k - 1):
	names.append(generate_name(t))
	t += 1
for word in s:
	if word == 'YES':
		names.append(generate_name(t))
		t += 1
	else:
		names.append(names[-min(k - 1, len(names))])
print(' '.join(names))


(n, k) = map(int, input().split())
a = list(input().split())
mem = []
mem2 = []
for i in 'abcdefghijklmnopqrstuvwxyz':
	mem.append(i)
	mem.append('a' + i)
	mem2.append('b' + i)
	mem2.append('c' + i)
dp = [-1] * n
c = 0
c2 = 0
for i in range(len(a)):
	if a[i] == 'NO':
		if dp[i] == -1:
			dp[i] = mem2[c2]
			dp[i + k - 1] = mem2[c2]
		else:
			dp[i + k - 1] = dp[i]
		c2 += 1
	else:
		for j in range(i, i + k):
			if dp[j] == -1:
				dp[j] = mem[c]
				c += 1
for i in range(n):
	if dp[i] == -1:
		dp[i] = 'a'
for i in dp:
	print(i[0].upper() + i[1:], end=' ')


def get_data_from_line(line, convert_func=float):
	values = []
	temp_string = ''
	for char in line:
		if char in ['\t', ' ']:
			values.append(convert_func(temp_string))
			temp_string = ''
			char = ''
		if char == '\n':
			break
		temp_string += char
	values.append(convert_func(temp_string))
	return values

def convert_str(string):
	if string == 'YES':
		return 1
	else:
		return 0
first_line = input()
second_line = input()
first_line_val = get_data_from_line(first_line, int)
second_line_val = get_data_from_line(second_line, convert_str)
count_soldier = first_line_val[0]
group_size = first_line_val[1]
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

def get_unique_name(number):
	name = ''
	name += alphabet[int(number / 26)]
	name += alphabet[number % 26].lower()
	return name
i = 0
result = []
while i < group_size - 1:
	result.append(get_unique_name(i))
	i += 1
while i < count_soldier:
	if second_line_val[i + 1 - group_size] == 1:
		result.append(get_unique_name(i))
	else:
		result.append(result[i - group_size + 1])
	i += 1
print(result[0], end='')
for i in range(1, len(result)):
	print(' ' + result[i], end='')
print()


(n, k) = map(int, input().split())
a = input().split()
uq_names = [chr(i) for i in range(ord('A'), ord('Z') + 1)]
uq_names += [s + 'a' for s in uq_names]
res = uq_names[:k - 1]
uni = k - 1
for (i, b) in enumerate(a):
	if b == 'YES':
		res.append(uq_names[uni])
		uni += 1
	else:
		res.append(res[i])
print(' '.join(res))


def name(n):
	if n < 26:
		return chr(n + ord('A'))
	else:
		return chr(n - 26 + ord('A')) + 'a'
(n, k) = tuple(map(int, input().split()))
data = list(map(lambda x: x == 'YES', input().split()))
res = []
for i in range(k - 1):
	res.append(name(i))
for i in range(k - 1, n):
	if data[i - k + 1]:
		res.append(name(i))
	else:
		res.append(res[i - k + 1])
print(' '.join(res))


R = lambda : map(int, input().split())
(n, k) = R()
l = []
(s, s2) = (ord('A'), ord('a'))
for i in range(k):
	if i < 26:
		l.append(chr(s + i))
	else:
		l.append('A' + chr(s2 + i % 26))
	if i < k - 1:
		print(l[i], end=' ')
s = [i for i in range(k - 1)]
(i, j) = (k - 1, 0)
c = input().split()
for m in range(n - k + 1):
	if c[m] == 'YES':
		print(l[i], end=' ')
		s.append(i)
		i = s[j]
	else:
		print(l[s[j]], end=' ')
		s.append(s[j])
	j = j + 1


(n, k) = map(int, input().split())
s = input().split()
ans = []
for i in range(26):
	ans.append(chr(65 + i) + 'a')
for i in range(24):
	ans.append(chr(65 + i) + 'b')
for i in range(n - k + 1):
	if s[i] == 'NO':
		ans[i + k - 1] = ans[i]
ans = ans[:n]
print(*ans)


(n, k) = map(int, input().split())
l_o = input().split()
a_n = ['A']
for i in range(1, n):
	diff = i - 25 if i >= 25 else 0
	a_n += [chr(ord('A') + i - (26 if diff != 0 else 0)) + ('' if diff == 0 else chr(ord('a') + diff))]
for i in range(n - k + 1):
	if l_o[i] == 'NO':
		a_n[i + k - 1] = a_n[i]
print(' '.join(a_n))


(n, k) = map(int, input().split())
names = []
for i in range(ord('a'), ord('z') + 1):
	names.append('A' + chr(i))
for i in range(ord('a'), ord('z') + 1):
	names.append('B' + chr(i))
pos = 0
a = input().split()
ans = []
for i in range(k - 1):
	ans.append(names[pos])
	pos += 1
for i in range(n - k + 1):
	if a[i] == 'YES':
		ans.append(names[pos])
		pos += 1
	else:
		ans.append(ans[i])
print(' '.join(ans))


(n, k) = map(int, input().split())
names = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Aa', 'Bb', 'Cc', 'Dd', 'Ee', 'Ff', 'Gg', 'Hh', 'Ii', 'Jj', 'Kk', 'Ll', 'Mm', 'Nn', 'Oo', 'Pp', 'Qq', 'Rr', 'Ss', 'Tt', 'Uu', 'Vv', 'Ww', 'Xx', 'Yy', 'Zz']
e = input().split()
names = names[:n]
for i in range(n - k + 1):
	if e[i] == 'NO':
		names[i + k - 1] = names[i]
ans = ' '.join(names)
print(ans)


names = list('A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Ab Bb Cb Db Eb Fb Gb Hb Ib Jb Kb Lb Mb Nb Ob Pb Qb Rb Sb Tb Ub Vb Wb Xb Gh Rg Df'.split())
(n, k) = map(int, input().split())
A = list(input().split())
find = False
ans = [0] * n
for i in range(n - k + 1):
	s = A[i]
	if find:
		if s == 'YES':
			c = 0
			while names[c] in ans[i:]:
				c += 1
			ans[i + k - 1] = names[c]
		else:
			ans[i + k - 1] = ans[i]
	elif s == 'NO':
		ans[i] = names[0]
	else:
		now = i
		for j in range(k):
			ans[now] = names[j]
			now += 1
		find = True
if not find:
	for i in range(n - k + 1, n):
		ans[i] = names[0]
print(' '.join(ans))


def main():
	(n, k) = map(int, input().split())
	res = ['AB'[i // 26] + chr(97 + i % 26) for i in range(n)]
	for (i, w) in enumerate(input().split()):
		if w == 'NO':
			res[i + k - 1] = res[i]
	print(*res)
main()


class CodeforcesTask771BSolution:

	def __init__(self):
		self.result = ''
		self.n_k = []
		self.notes = []

	def read_input(self):
		self.n_k = [int(x) for x in input().split(' ')]
		self.notes = input().split(' ')

	def process_task(self):
		names = [0] * self.n_k[0]
		for x in range(self.n_k[0] - self.n_k[1] + 1):
			if self.notes[x] == 'NO':
				if not names[x]:
					names[x] = x + 1
					names[x + self.n_k[1] - 1] = x + 1
				else:
					names[x + self.n_k[1] - 1] = names[x]
		nn = max(names) + 1
		for x in range(len(names)):
			if not names[x]:
				names[x] = nn
				nn += 1
		nn -= 1
		tna = [chr(ord('A') + x) for x in range(26)] + [chr(ord('A') + x) + chr(ord('a') + x) for x in range(26)] + [chr(ord('A') + x) + chr(ord('a') + x) * 2 for x in range(26)]
		self.result = ' '.join([tna[x] for x in names])

	def get_result(self):
		return self.result
Solution = CodeforcesTask771BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


import string
names = []
for t in range(9):
	for i in range(26):
		l = string.ascii_uppercase[i]
		names.append(l + (l * t).lower())
current = []
(n, k) = map(int, input().split())
stat = input().split()
if stat[0] == 'YES':
	for i in range(k):
		current.append(names[i])
else:
	current.append('A')
	for i in range(k - 2):
		current.append(names[i + 1])
	current.append('A')
counter = 1
for item in stat[1:]:
	if item == 'YES':
		current.append(names[counter + 100])
	else:
		current.append(current[counter])
	counter += 1
print(' '.join(current))


def parent(x):
	global color
	y = x
	while color[x] != x:
		x = color[x]
	while y != x:
		(color[y], y) = (x, color[y])
	return x

def union(x, y):
	global color
	x = parent(x)
	y = parent(y)
	if size[x] < size[y]:
		(x, y) = (y, x)
	color[y] = x
	size[x] += size[y]
(n, k) = map(int, input().split())
a = input().split()
res = list(range(n))
color = list(range(n))
size = [1] * n
for i in range(n - k + 1):
	if a[i] == 'NO':
		union(i, i + k - 1)
alph = ''.join((chr(i) for i in range(ord('a'), ord('z') + 1)))
names = [x + y for x in alph.upper() for y in alph]
print(*[names[x] for x in color])


c = []
for i in range(65, 91):
	for j in range(97, 123):
		c.append(chr(i) + chr(j))
(n, k) = map(int, input().split())
l = list(map(str, input().split()))
z = 0
p = []
if l[0] == 'YES':
	p += c[z:z + k]
	z += k
else:
	p += c[z:z + k - 1]
	p += [c[z]]
	z += k - 1
for i in range(1, len(l)):
	if l[i] == 'YES':
		p += [c[z]]
		z += 1
	else:
		p += [p[len(p) - k + 1]]
print(*p)


names = [i for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'] + ['AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'[i:i + 2] for i in range(0, len('AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'), 2)]
(n, k) = map(int, input().split())
yes_no = input().split()
guess = names[:n]
for i in range(len(yes_no)):
	if yes_no[i] == 'NO':
		guess[i + k - 1] = guess[i]
print(' '.join(guess))


(n, k) = map(int, input().split())
names = []

def getNext(a):
	if a[1] == 'z':
		return chr(ord(a[0]) + 1) + 'a'
	else:
		return a[0] + chr(ord(a[1]) + 1)
a = list(input().split())
for i in range(len(a)):
	a[i] = 1 if a[i] == 'YES' else 0
tmp = 'Aa'
names.append(tmp)
if a[0]:
	for i in range(k - 1):
		tmp = getNext(tmp)
		names.append(tmp)
else:
	names.append(tmp)
	for i in range(k - 2):
		tmp = getNext(tmp)
		names.append(getNext(tmp))
for i in range(k, n):
	if a[i - k + 1]:
		tmp = getNext(tmp)
		names.append(getNext(tmp))
	else:
		names.append(names[i - k + 1])
print(*names)


(n, k) = map(int, input().split())
possible_names = [a + b for a in 'QWERTYUIOPLKJHGFDSAZXCVBNM' for b in 'qwertyuioplkjhgfdsazxcvbnm']
names = [possible_names.pop() for i in range(k - 1)]
for word in input().split():
	if word == 'YES':
		names.append(possible_names.pop())
	else:
		names.append(names[-k + 1])
print(*names)


import random

def random_str(rango, pos):
	while True:
		x = random.randint(65, 90)
		string = chr(x)
		x = random.randint(1, 10)
		for i in range(x - 1):
			rand = random.randint(97, 122)
			string += chr(rand)
		if string not in rango:
			break
	return string

def print_array(array):
	result = ''
	for string in array:
		result += string + ' '
	print(result)
(n, k) = map(int, input().strip().split(' '))
strings = input().strip().split(' ')
soldiers = [-1] * n
for i in range(n):
	soldiers[i] = random_str(soldiers, i)
pos = 0
for string in strings:
	if string == 'NO':
		aux = soldiers[pos]
		soldiers[pos + k - 1] = aux
	pos += 1
print_array(soldiers)


l = ['Aa', 'Ab', 'Ac', 'Ad', 'Ae', 'Af', 'Ag', 'Ah', 'Ai', 'Aj', 'Ak', 'Al', 'Am', 'An', 'Ao', 'Ap', 'Aq', 'Ar', 'As', 'At', 'Au', 'Av', 'Aw', 'Ax', 'Ay', 'Az', 'Aaa', 'Abb', 'Acc', 'Add', 'Aee', 'Aff', 'Agg', 'Ahh', 'Aii', 'Ajj', 'Akk', 'All', 'Amm', 'Ann', 'Aoo', 'App', 'Aqq', 'Arr', 'Ass', 'Att', 'Auu', 'Avv', 'Aww', 'Axx', 'Ayy']
(n, k) = map(int, input().split())
li = list(map(str, input().split()))
lc = l[:n]
for i in range(len(li)):
	if li[i] == 'NO':
		lc[i + k - 1] = lc[i]
for i in lc:
	print(i, end=' ')


from string import ascii_uppercase
(n, k) = map(int, input().split())
s = list(input().split())
names = []
for i in ascii_uppercase:
	names.append(i)
	names.append('A' + str(i).lower())
a = []
if s[0] == 'YES':
	for i in range(k):
		a.append(names[i])
elif s[0] == 'NO':
	for i in range(k - 1):
		a.append(names[i])
	a.append(names[0])
for j in range(1, len(s)):
	if s[j] == 'YES':
		a.append(names[k - 1 + j])
	else:
		a.append(a[j])
print(*a)


(n, k) = map(int, input().split())
l = [True if x == 'YES' else False for x in input().split()]
res = list(range(k - 1))
for i in l:
	if i:
		for j in range(k):
			if j not in res[-k + 1:]:
				res.append(j)
				break
	else:
		res.append(res[-k + 1])
names = [chr(x) + chr(y) for x in range(ord('A'), ord('Z') + 1) for y in range(ord('a'), ord('z') + 1)]
for i in res:
	print(names[i], end=' ')
print()


def get(x):
	return chr(ord('A') + x // 26) + chr(ord('a') + x % 26)
read = lambda : map(int, input().split())
(n, k) = read()
a = input().split()
ans = [0] * n
num = 1
for i in range(k - 1):
	ans[i] = num
	num += 1
for i in range(k - 1, n):
	cur = a[i - k + 1]
	if cur == 'YES':
		num += 1
		ans[i] = num
	else:
		ans[i] = ans[i - k + 1]
res = ' '.join(map(str, [get(i) for i in ans]))
print(res)


def solve(n, k, a):
	t = 0
	ans = ['' for i in range(n)]
	i = 0
	while i < len(a) and a[i] == 'NO':
		ans[i] = names[0]
		i += 1
	if i == len(a):
		for j in range(i, i + k - 1):
			ans[j] = ans[0]
		return ans
	for j in range(i, i + k):
		ans[j] = names[t]
		t += 1
	while i < len(a):
		if a[i] == 'NO':
			ans[i + k - 1] = ans[i]
		else:
			ans[i + k - 1] = names[t]
			t += 1
		i += 1
	return ans
names = []
for i in range(ord('A'), ord('Z') + 1):
	for j in range(ord('a'), ord('z') + 1):
		names.append(chr(i) + chr(j))
(n, k) = list(map(int, input().strip().split()))
is_ok = input().strip().split()
ans = solve(n, k, is_ok)
print(*ans)


names = ['Edurounds', 'Flushed', 'Orz', 'Yt', 'Ggh', 'Fg', 'Fdg', 'Fdga', 'Fgs', 'sdcv', 'anantcool', 'anantorz', 'bruhone', 'lol', 'geniosity', 'bruhtwo', 'bruhthree', 'bruhprime', 'twoprimeq', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'anantgh', 'eduround', 'brickedu', 'moorz', 'bruh', 'qw', 'we', 'er', 'rt']
names1 = []
for b in names:
	names1.append(b.title())
(n, k) = map(int, input().split())
p = 0
a = input().split()
res = names1[:n]
for i in range(n - k + 1):
	if a[i] == 'NO':
		res[i + k - 1] = res[i]
print(*res)


def sToName(s):
	return 'A' + chr(s // 26 + ord('a')) + chr(s % 26 + ord('a'))
(n, k) = map(int, input().split())
a = list(map(lambda x: x == 'YES', input().split()))
d = [0] * n
s = -1
for i in range(k - 1):
	s += 1
	d[i] = s
for i in range(k - 1, n):
	if a[i - k + 1]:
		s += 1
		d[i] = s
	else:
		d[i] = d[i - k + 1]
print(*list(map(lambda x: sToName(x), d)))


(n, k) = map(int, input().split())
v = ['AB'[i // 26] + 'abcdefghijklmnopqrstuvwxyz'[i % 26] for i in range(n)]
for (i, si) in enumerate(input().split()):
	if si == 'NO':
		v[i + k - 1] = v[i]
print(' '.join(v))


from string import ascii_lowercase
import collections
(n, m) = map(int, input().split())
l = list(input().split())
answer = collections.deque()
Names = []
(start, end) = (0, m - 1)
for i in ascii_lowercase.upper():
	for j in ascii_lowercase:
		Names.append(i + j)
for i in range(0, m - 1):
	print(Names[i], end=' ')
	answer.append(Names[i])
for i in l:
	if i == 'YES':
		answer.append(Names[end])
		end += 1
	else:
		answer.append(answer[0])
	answer.popleft()
	print(answer[-1], end=' ')


from random import *
(n, k) = list(map(int, input().split()))
s = input().split()
soliders = ['' for i in range(n)]

def newname():
	name = chr(randint(65, 90))
	for i in range(9):
		name += chr(randint(97, 122))
	return name
if s[0] == 'NO':
	soliders[0] = newname()
	soliders[1] = soliders[0]
	for j in range(2, 2 + k):
		if j > n - 1:
			break
		soliders[j] = newname()
else:
	for j in range(0, k):
		soliders[j] = newname()
for i in range(1, n - k + 1):
	if s[i] == 'YES':
		soliders[i + k - 1] = newname()
	else:
		soliders[i + k - 1] = soliders[i]
print(*soliders)


(n, k) = input().split()
b = input().split()
out = list(range(int(n)))

def intToName(i):
	letters = ord('Z') - ord('A') + 1
	res = ''
	first = True
	while True:
		(i, c) = divmod(i, letters)
		if first:
			res += chr(ord('A') + c)
		else:
			res += chr(ord('a') + c)
		if i == 0:
			return res
		else:
			i -= 1
		first = False
i = 0
while i <= int(n) - int(k):
	soldierFirst = i
	soldierLast = i + int(k) - 1
	if b[i] == 'NO':
		out[soldierLast] = out[soldierFirst]
	i += 1
for i in range(int(n) - 1):
	print(intToName(out[i]), end=' ')
print(intToName(out[int(n) - 1]))


import random
(n, m) = map(int, input().split(' '))
s = input().split(' ')
ans = [i for i in range(n)]
for i in range(m):
	ans[i] = 'A'
	for j in range(i):
		ans[i] += 'a'
	if len(ans[i]) > 10:
		ans[i] = ans[i][:1] + chr(random.randrange(0, 25) + ord('a')) + chr(random.randrange(0, 25) + ord('a')) + chr(random.randrange(0, 25) + ord('a'))
if s[0] == 'NO':
	ans[m - 1] = ans[0]
id = m
j = 1
for i in range(m, n):
	if s[j] == 'NO':
		ans[i] = ans[i - m + 1]
	elif len(ans[i - 1]) <= 8:
		ans[i] = ans[i - 1] + chr(random.randrange(0, 25) + ord('a')) + chr(random.randrange(0, 25) + ord('a'))
	else:
		ans[i] = ans[i - 1]
		ans[i] = ans[i][:1] + chr(random.randrange(0, 25) + ord('a')) + chr(random.randrange(0, 25) + ord('a')) + chr(random.randrange(0, 25) + ord('a'))
	j += 1
for i in ans:
	print(i, end=' ')


import math, sys, itertools

def main():
	(n, k) = map(int, input().split())
	lst = input().split()
	d = []
	it = 0
	itd = 0
	for i in range(k):
		if it > 25:
			itd += 1
			it = 0
		d.append(chr(65 + itd) + chr(97 + it))
		it += 1
	ans = []
	for i in range(k - 1):
		ans.append(d.pop())
	for i in range(k - 1, n):
		if lst[i - (k - 1)] == 'NO':
			ans.append(ans[i - (k - 1)])
		else:
			ans.append(d.pop())
			d.append(ans[i - (k - 1)])
	for i in range(n):
		print(ans[i], end=' ')
	print()

def __starting_point():
	main()
__starting_point()


(n, k) = map(int, input().split())
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
names = []
for x in a:
	names.append(x)
	names.append(x + x.lower())
names = names[:n]
s = input().split()
for i in range(n - k + 1):
	if s[i] == 'NO':
		names[i + k - 1] = names[i]
print(' '.join(names))


(n, k) = list(map(int, input().split()))
a = input().split()
names = [chr(ord('A') + i) for i in range(26)] + [chr(ord('A') + i) + chr(ord('a') + i) for i in range(26)]
ans = [names[i] for i in range(n)]
for i in range(k - 1, n):
	if a[i - k + 1] == 'NO':
		ans[i] = ans[i - k + 1]
print(*ans)


from collections import Counter, OrderedDict
from itertools import permutations as perm
from fractions import Fraction
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
from math import *
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(n, k) = gil()
x = 0
name = []
for ch in 'AB':
	for c in 'abcdefghijklmnopqrstuvwxyz':
		name.append(ch + c)
ans = []
for i in range(k - 1):
	ans.append(name[x])
	x += 1
for ch in gl():
	if ch == 'YES':
		ans.append(name[x])
		x += 1
	else:
		ans.append(ans[-k + 1])
print(' '.join(ans))


(n, k) = map(int, input().split())
l = list(map(str, input().split()))
A = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Aa', 'Ab', 'Ac', 'Ad', 'Ae', 'Af', 'Ag', 'Ah', 'Ai', 'Aj', 'Ak', 'Al', 'Am', 'An', 'Ao', 'Ap', 'Aq', 'Ar', 'As', 'At', 'Au', 'Av', 'Aw', 'Ax', 'Ay', 'Az']
ans = []
for i in range(k - 1):
	ans.append(A[i])
temp1 = 0
temp2 = k - 1
for i in range(len(l)):
	if l[i] == 'YES':
		ans.append(A[temp2])
		temp2 += 1
	else:
		ans.append(ans[-k + 1])
print(*ans)


from io import BytesIO, IOBase
from math import sqrt
import sys, os
from os import path
inpl = lambda : list(map(int, input().split()))
inpm = lambda : map(int, input().split())
inpi = lambda : int(input())
inp = lambda : input()
(rev, ra, l) = (reversed, range, len)
P = print
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 input():
	return sys.stdin.readline().rstrip('\r\n')

def B(n):
	return bin(n).replace('0b', '')

def factors(n):
	arr = []
	for i in ra(2, int(sqrt(n)) + 1):
		if n % i == 0:
			arr.append(i)
			if i * i != n:
				arr.append(int(n / i))
	return arr

def dfs(arr, n):
	pairs = [[i + 1] for i in ra(n)]
	vis = [0] * (n + 1)
	for i in ra(l(arr)):
		pairs[arr[i][0] - 1].append(arr[i][1])
	pairs[arr[i][1] - 1].append(arr[i][0])
	comp = []
	for i in ra(n):
		stack = [pairs[i]]
		temp = []
		if vis[stack[-1][0]] == 0:
			while len(stack) > 0:
				if vis[stack[-1][0]] == 0:
					temp.append(stack[-1][0])
					vis[stack[-1][0]] = 1
					s = stack.pop()
					for j in s[1:]:
						if vis[j] == 0:
							stack.append(pairs[j - 1])
				else:
					stack.pop()
			comp.append(temp)
	return comp
from bisect import bisect_left as bl
from bisect import bisect_right as br
import sys, operator, math, operator
from collections import Counter
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import random
(n, k) = inpm()
li = input().split()
le = len(li)
arr = [0] * 51
c = 65
ans = [0] * n
for i in ra(1, 27):
	arr[i] = chr(c)
	c += 1
c = 65
for i in ra(27, 51):
	arr[i] = chr(c) + chr(97)
	c += 1
for i in ra(le):
	if li[i] == 'NO':
		li[i] = 0
	else:
		li[i] = 1
if li[0] == 0:
	ans[0] = 1
	for i in ra(1, k):
		ans[i] = i
else:
	for i in ra(k):
		ans[i] = i + 1
for i in ra(1, le):
	if li[i] == 0:
		ans[i + k - 1] = ans[i]
	else:
		for j in ra(1, 51):
			if j not in ans[i:i + k - 1]:
				ans[i + k - 1] = j
				break
for i in ra(n):
	P(arr[ans[i]], end=' ')


(n, k) = map(int, input().split())
words = []
for i in range(ord('A'), ord('Z') + 1):
	for j in range(ord('a'), ord('z') + 1):
		words.append(chr(i) + chr(j))
our = input().split()
res = [i for i in range(n)]
for j in range(50):
	for i in range(len(our)):
		if our[i] == 'NO':
			res[i] = res[i + k - 1]
for elem in res:
	print(words[elem], end=' ')


def name(n):
	return chr(ord('A') + n % 26) + chr(ord('a') + n // 26)

def main():
	(n, k) = map(int, input().split())
	arr = list(map(str, input().split()))
	if arr.count('YES') == 0:
		for i in range(n):
			print('Max ', end='')
		return
	ans = ['' for i in range(n)]
	x = arr.index('YES')
	for i in range(k):
		ans[x + i] = name(i + x)
	for i in range(x + 1, n - k + 1):
		if arr[i] == 'YES':
			ans[i + k - 1] = name(i + k - 1)
		else:
			ans[i + k - 1] = ans[i]
	for i in range(x - 1, -1, -1):
		if arr[i] == 'YES':
			ans[i] = name(i)
		else:
			ans[i] = ans[i + k - 1]
	print(*ans)
main()


import sys

def main():
	names = []
	for i in range(26):
		s = 'A' + chr(ord('a') + i)
		s1 = 'X' + chr(ord('a') + i)
		names.append(s)
		names.append(s1)
	(n, k) = map(int, sys.stdin.readline().split())
	r = list(sys.stdin.readline().split())
	res = ['Ho'] * n
	cur = 0
	firstYes = -1
	for i in range(n - k + 1):
		if r[i] == 'YES':
			firstYes = i
			break
	if firstYes == -1:
		print(' '.join(res))
		return
	for i in range(firstYes + 1, firstYes + k):
		res[i] = names[cur]
		cur += 1
	for i in range(firstYes + 1, n - k + 1):
		if r[i] == 'YES':
			res[i + k - 1] = names[cur]
			cur += 1
		else:
			res[i + k - 1] = res[i]
	print(' '.join(res))
main()


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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 = self.os.read(self._fd, max(self.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 = self.os.read(self._fd, max(self.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:
			self.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')
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]
MOD = 10 ** 9 + 7

def solve():
	poss = [chr(ord('a') + j).upper() for j in range(26)]
	poss2 = ['A' + x.lower() for x in poss]
	names = poss + poss2
	(N, K) = getInts()
	S = getStrs()
	ans = [names[j] for j in range(K - 1)]
	curr = K - 1
	for i in range(K - 1, N):
		if S[i - K + 1] == 'NO':
			ans.append(ans[i - K + 1])
		else:
			ans.append(names[curr])
			curr += 1
	print(*ans)
	return
solve()


(n, k) = [int(i) for i in input().split()]
s = [i for i in input().split()]
res = []
c1 = ord('A')
c2 = ord('a')
c3 = ord('a')
for i in range(0, k - 1):
	res1 = ''
	if c1 == ord('Z') and c2 == ord('z'):
		res1 = chr(c1) + chr(c2) + chr(c3)
		c3 += 1
	elif c1 == ord('Z'):
		res1 = chr(c1) + chr(c2)
		c2 += 1
	else:
		res1 = chr(c1)
		c1 += 1
	res.append(res1)
for i in range(len(s)):
	if s[i] == 'NO':
		res.append(res[i])
	else:
		res1 = ''
		if c1 == ord('Z') and c2 == ord('z'):
			res1 = chr(c1) + chr(c2) + chr(c3)
			c3 += 1
		elif c1 == ord('Z'):
			res1 = chr(c1) + chr(c2)
			c2 += 1
		else:
			res1 = chr(c1)
			c1 += 1
		res.append(res1)
for i in res:
	print(i, end=' ')