403762: GYM101262 B Vera And LCS
Description
Vera is learning about the longest common subsequence problem.
A string is a (possibly empty) sequence of lowercase letters. A subsequence of a string S is a string obtained by deleting some letters of S (possibly none or all). For example "vra", "a", "", and "vera" are all subsequences of "vera". The longest common subsequence (LCS) of two strings A, B is a string that is a subsequence of A and B and has the maximum length among all strings that are a subsequence of A and B. There could be multiple LCS for two given strings. For example a LCS of "vera" and "eats" is "ea".
For homework she was given two strings A, B, both of length N and she had to determine the length of the LCS of A and B. She determined the answer to be K but lost B. Given A and K, help her find a possible value of B. It's possible that Vera may have made a mistake and no such B exists, in that case output "WRONGANSWER" (without quotes).
Constraints:
1 ≤ N ≤ 2000
0 ≤ K ≤ 2000
N, K are integers
A consists of N lowercase letters
InputThe input will be in the format:
N K
A
OutputOutput one line consisting of the string B of N lowercase letters, or "WRONGANSWER" if no B is valid. If there are multiple correct B output any of them.
ExamplesInput4 2Output
vera
eatsInput
4 5Output
vera
WRONGANSWERNote
For the first example, another possible answer is "uber".