import re


def lower(s):
    s = list(s)
    for i in range(len(s)):
        if s[i] == "I":
            continue
        s[i] = s[i].lower()
    return ''.join(s)


def do(old: str, new: str, s: str):
    s = re.sub(r"(?<=\W)" + old + "(?=\W)", new, s)
    s = re.sub(r"(?<=\W)" + old + "$", new, s)
    s = re.sub(r"^" + old + "(?=\W)", new, s)
    return re.sub(r"^" + old + "$", new, s)


chars = ",.'\"/?*-+=-_^&%$#@!~`·<>[]{}|;:!"
n = int(input())
for i in range(n):
    s = input()
    print(s)
    #s = re.sub(r" +", " ", s)
    s = re.sub(r"(?=\w+\b) +(?=\w+\b)", " ", s)
    s = s.strip()
    s = lower(s)
    s = do("I", "you", s)
    s = do("me", "you", s)
    s = do("can you", "I can", s)
    s = do("could you", "I could", s)
    s = s.replace("?", "!")
    for c in chars:
        s = s.replace(" " + c, c)
    print("AI: " + s)