• + 0 comments
    import re
    for _ in range(int(input())):
        line = input()
        pattern = re.compile(r'(?<=[\s:])#(?:[a-fA-F0-9]{6}|[a-fA-F0-9]{3})')
        re.sub(pattern,lambda m: print(m.group()),line)