#P11092. Maximum Moscow Number

    ID: 13149 Type: Default 1000ms 256MiB

Maximum Moscow Number

Maximum Moscow Number

You are given several numbers. Each number is represented as a string containing only uppercase English letters, which we refer to as Moscow digits. However, some of the characters in these numbers are replaced with question marks ('?'). Your task is to replace each question mark with an uppercase letter in order to obtain the maximum possible number.

The maximum is achieved by replacing each '?' with the letter Z, since in the ordering of the Moscow digits, Z is considered the largest digit. In other words, if a number is given by a string s, then its maximum version is given by:

$s^* = s, \text{with every } '?' \text{ replaced by } 'Z'$

inputFormat

The first line contains an integer T denoting the number of test cases.

Each of the next T lines contains a single string representing a Moscow number, which consists of uppercase English letters and possibly question marks ('?').

outputFormat

For each test case, output the maximum Moscow number obtained by replacing every '?' with 'Z'.

sample

3
A?C
??
XYZ
AZC

ZZ XYZ

</p>