F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Rikka with string

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1770    Accepted Submission(s): 661


Problem Description
As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:


One day, Yuta got a string which contains n letters but Rikka lost it in accident. Now they want to recover the string. Yuta remembers that the string only contains lowercase letters and it is not a palindrome string. Unfortunately he cannot remember some letters. Can you help him recover the string?


It is too difficult for Rikka. Can you help her?
 

Input
This problem has multi test cases (no more than $20$). For each test case, The first line contains a number $n(1 \leq n \leq 1000)$. The next line contains an n-length string which only contains lowercase letters and ¡®?¡¯ ¨C the place which Yuta is not sure.
 

Output
For each test cases print a n-length string ¨C the string you come up with. In the case where more than one string exists, print the lexicographically first one. In the case where no such string exists, output ¡°QwQ¡±.
 

Sample Input
5 a?bb? 3 aaa
 

Sample Output
aabba QwQ
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 17:54:19, Gzip enabled