logo AlgoBeat OnlineJudge
登录 注册

#216173. [ICPC 2024 NAC] Not Another Constructive!

内存限制:2048 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Sick of solving geometry problems, you decide to solve the following constructive problem: find a string of length that contains exactly not necessarily contiguous subsequences of NAC.

This problem seems too familiar though. Here’s the twist - your friend has given you part of the string, so you must fill in the remaining characters!

输入格式

The first line of input contains two integers () and (), where is the length of the string and is the number of not necessarily contiguous subsequences of NAC that the output must contain.

The second line contains a string of length exactly , consisting only of uppercase letters and/or question marks.

输出格式

Output a string of upper case letters, replacing each question mark in the input string with an uppercase letter so that the resulting string has exactly subsequences of NAC. If this is not possible, output . Any uppercase letters in the input string must be kept in their position. There may be multiple possible solutions for any given test case; any correct solution will be accepted.

样例

样例输入 1

22 2
N??A??????C???????????

样例输出 1

NOTANOTHERCONSTRUCTIVE

样例输入 2

18 0
COUNTINGSATELLITES

样例输出 2

COUNTINGSATELLITES

样例输入 3

2 1
??

样例输出 3

-1