CF771B.Bear and Different Names

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 nn soldiers standing in a row, numbered 11 through nn . The general wants to choose a group of kk consecutive soldiers. For every kk consecutive soldiers, the general wrote down whether they would be an effective group or not.

You managed to steal the general's notes, with nk+1n-k+1 strings s1,s2,...,snk+1s_{1},s_{2},...,s_{n-k+1} , each either "YES" or "NO".

  • The string s1s_{1} describes a group of soldiers 11 through kk ("YES" if the group is effective, and "NO" otherwise).
  • The string s2s_{2} describes a group of soldiers 22 through k+1k+1 .
  • And so on, till the string snk+1s_{n-k+1} that describes a group of soldiers nk+1n-k+1 through nn .

Your task is to find possible names of nn soldiers. Names should match the stolen notes. Each name should be a string that consists of between 11 and 1010 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.

输入格式

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

The second line contains nk+1n-k+1 strings s1,s2,...,snk+1s_{1},s_{2},...,s_{n-k+1} . The string sis_{i} is "YES" if the group of soldiers ii through i+k1i+k-1 is effective, and "NO" otherwise.

输出格式

Find any solution satisfying all given conditions. In one line print nn 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 11 to 1010 .

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

输入输出样例

  • 输入#1

    8 3
    NO NO YES YES YES NO
    

    输出#1

    Adam Bob Bob Cpqepqwer Limak Adam Bob Adam
  • 输入#2

    9 8
    YES NO
    

    输出#2

    R Q Ccccccccc Ccocc Ccc So Strong Samples Ccc
  • 输入#3

    3 2
    NO NO
    

    输出#3

    Na Na Na

说明/提示

In the first sample, there are 88 soldiers. For every 33 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 s1s_{1} is "NO".
  • Soldiers 22 through 44 (Bob, Bob, Cpqepqwer) wouldn't be effective either, and the string s2s_{2} is "NO".
  • Soldiers 33 through 55 (Bob, Cpqepqwer, Limak) would be effective, and the string s3s_{3} is "YES".
  • ...,
  • Soldiers 66 through 88 (Adam, Bob, Adam) wouldn't be effective, and the string s6s_{6} is "NO".
首页