Problem: Vasya came up with a password to register for EatForces — a string s. The password in EatForces should be a string, consisting of lowercase and uppercase Latin letters and digits.

But since EatForces takes care of the security of its users, user passwords must contain at least one digit, at least one uppercase Latin letter and at least one lowercase Latin letter. For example, the passwords "abaCABA12", "Z7q" and "3R24m" are valid, and the passwords "qwerty", "qwerty12345" and "Password" are not. 

A substring of string s is a string x = s_l s_{l + 1} ... s_{l + len - 1} (1 ≤ l ≤ |s|, 0 ≤ len ≤ |s| - l + 1). len is the length of the substring. Note that the empty string is also considered a substring of s, it has the length 0.

Vasya's password, however, may come too weak for the security settings of EatForces. He likes his password, so he wants to replace some its substring with another string of the same length in order to satisfy the above conditions. This operation should be performed exactly once, and the chosen string should have the minimal possible length.

Note that the length of s should not change after the replacement of the substring, and the string itself should contain only lowercase and uppercase Latin letters and digits.

Input

The first line contains a single integer T (1 ≤ T ≤ 100) — the number of testcases.

Each of the next T lines contains the initial password s~(3 ≤ |s| ≤ 100), consisting of lowercase and uppercase Latin letters and digits.

Only T = 1 is allowed for hacks.

Output

For each testcase print a renewed password, which corresponds to given conditions. 

The length of the replaced substring is calculated as following: write down all the changed positions. If there are none, then the length is 0. Otherwise the length is the difference between the first and the last changed position plus one. For example, the length of the changed substring between the passwords "abcdef" → "a7cdEf" is 4, because the changed positions are 2 and 5, thus (5 - 2) + 1 = 4.

It is guaranteed that such a password always exists.

If there are several suitable passwords — output any of them.

Example

Input

2
abcDCE
htQw27


Output

abcD4E
htQw27

Note

In the first example Vasya's password lacks a digit, he replaces substring "C" with "4" and gets password "abcD4E". That means, he changed the substring of length 1.

In the second example Vasya's password is ok from the beginning, and nothing has to be changed. That is the same as replacing the empty substring with another empty substring (length 0).

Solution (in PYTHON):

Solution:
# # from generic_variables import *
# # import requests
# # import os
# # import time
# # valiurl = LoginUrl+ValidateCodeUrl
# #
# # for i in range(100):
# #     with open(os.path.join('ValidateCodeDir',str(i)+'.jpeg'),'wb')as f:
# #         f.write(requests.get(valiurl).content)
# #         # time.sleep(3)
# # for i in range(1000):
# #     os.remove(os.path.join('ValidateCodeDir',str(i)+'.png'))
#
# MAXN_EDGE = 100000
# head = [0]*MAXN_EDGE
# w = [MAXN_EDGE]*MAXN_EDGE
# To = [MAXN_EDGE]*MAXN_EDGE
# Next = [MAXN_EDGE]*MAXN_EDGE
# head = [MAXN_EDGE]*MAXN_EDGE
# vis = [MAXN_EDGE]*MAXN_EDGE
# tot= 0
# def init(n):
#     global tot
#     tot = 0
#     for i in range(n+1):
#         print i
#         head[i] = -1
# def add_edge(u,v,d):
#     global tot
#     print tot,u,v,d,head[u]
#     w[tot]  =d
#     To[tot] = v
#     Next[tot] = head[u]
#     head[u] = tot
#     tot  = tot +1
#
# if __name__ == '__main__':
#     n = int(raw_input('input n:'))
#     m = int(raw_input('input m:'))
#     init(n)
#     for i in range(m):
#         u = int(raw_input())
#         v = int(raw_input())
#         d = int(raw_input())
#         add_edge(u,v,d)
#         add_edge(v,u,d)
#     for i in range(n):
#         vis[i] = 0
#     for i in range(n):
#         vis[i] = 1
#         j = head[i]
#         while j != -1:
#             y = To[j]
#             print i,j
#             j = Next[j]
#
#
#
#

# if __name__ == '__main__':
#     n = int(raw_input())
#     strs = raw_input()
#     info = 0
#     for i in strs:
#         if i =='8':
#             info+=1
#     ans = n/11
#     if ans<info:
#         print ans
#     else:
#         print info


# if __name__ == '__main__':
#     n, L, a = map(int, raw_input().split())
#     t = [0]*n
#     l = [0]*n
#     for i in range(n):
#         t[i],l[i] = map(int,raw_input().split())
#     ans = 0
#     for i in range(n):
#        if i == 0:
#            ans = ans +t[i]/a
#            # print t[i],t[i]/a
#        elif i == n-1:
#            ans = ans + (t[i] - t[i - 1] - l[i - 1]) / a
#            ans  = ans + (L - t[i] - l[i])/a
#            # print L - t[i] - l[i],(L - t[i] - l[i])/a
#        else:
#            ans  = ans + (t[i] - t[i-1] - l[i-1])/a
#            # print t[i+1] - t[i] - l[i],(t[i+1] - t[i] - l[i])/a
#     if n == 0:
#         ans = L/a
#     print ans
'''
8 996005 13
163374 322652
665313 69632
963257 23750
990366 2842
994610 740
995706 90
995992 1
995998 7
'''
def isU(s):
    if s<='Z' and s>='A':
        return True
    return False
def isL(s):
    if s<='z' and s>='a':
        return True
    return False
def isD(s):
    if s<='9' and s>='0':
        return True
    return False
if __name__ == '__main__':
    n = int(raw_input())
    for i in range(n):
        s = raw_input()
        strs = [i for i in s]
        # print strs
        hu = 0
        hl = 0
        hd = 0
        ctu = -1
        ctl = -1
        ctd = -1
        for j in range(len(s)):
           if isD(s[j]):
               # print 'asd'
               if hd == 0:
                   hd = 1
                   if ctd != -1:
                       if hl == 0 and ctl == -1:
                           ctl = ctd
                       elif hu == 0 and ctu == -1:
                           ctu = ctd
                       ctd = -1
               else:
                   if hl == 0 and ctl == -1:
                       ctl = j
                   elif hu == 0 and ctu == -1:
                       ctu = j

           if isL(s[j]):
               # print 'lll'
               if hl == 0:
                   hl = 1
                   if ctl != -1:
                       if hd == 0 and ctd == -1:
                           ctd = ctl
                       elif hu == 0 and ctu == -1:
                           ctu = ctl
                       ctl = -1
               else:
                   if hd == 0 and ctd == -1:
                       ctd = j
                   elif hu == 0 and ctu == -1:
                       ctu = j

           if isU(s[j]):
               if hu == 0:
                   hu = 1
                   if ctu != -1:

                       if hl == 0 and ctl == -1:
                           ctl = ctu
                       elif hd == 0 and ctd == -1:
                           ctd = ctu
                       ctu = -1
               else:
                   if hl == 0 and ctl == -1:
                       ctl = j
                   elif hd == 0 and ctd == -1:
                       ctd = j
        # print hd,hl,hu
        # print ctd,ctu,ctl
        for i in range(len(s)):
            if i == ctl:
                strs[i]='a'
            elif i == ctd:
                strs[i]='1'
            elif i == ctu:
                strs[i]='A'
        print ''.join(strs)
        # print sd