• + 0 comments
    import re
    for _ in range(int(input())):
        print(re.sub(r'(?<= )&&(?= )', 'and', re.sub(r'(?<= )\|\|(?= )', 'or', input())))