for tc in range(1,int(input())+1):
    string = input()

    print(".", end="")
    for i in range(len(string)):
        print(".#..", end="")

    print()
    print(".", end="")
    for i in range(len(string)):
        print("#.#.", end="")

    print()
    print("#",end="")
    for i in range(len(string)):
        print(".{}.#".format(string[i]), end="")

    print()
    print(".", end="")
    for i in range(len(string)):
        print("#.#.", end="")

    print ()
    print(".", end="")
    for i in range(len(string)):
        print(".#..", end="")
    print()


4ce462de298ef2bcd6c48870047216fc4ad2c01f
<mask token>

for tc in range(1, int(input()) + 1):
    string = input()
    print('.', end='')
    for i in range(len(string)):
        print('.#..', end='')
    print()
    print('.', end='')
    for i in range(len(string)):
        print('#.#.', end='')
    print()
    print('#', end='')
    for i in range(len(string)):
        print('.{}.#'.format(string[i]), end='')
    print()
    print('.', end='')
    for i in range(len(string)):
        print('#.#.', end='')
    print()
    print('.', end='')
    for i in range(len(string)):
        print('.#..', end='')
    print()

for tc in range(1,int(input())+1):
    string = input()

    print(".", end="")
    for i in range(len(string)):
        print(".#..", end="")

    print()
    print(".", end="")
    for i in range(len(string)):
        print("#.#.", end="")

    print()
    print("#",end="")
    for i in range(len(string)):
        print(".{}.#".format(string[i]), end="")

    print()
    print(".", end="")
    for i in range(len(string)):
        print("#.#.", end="")

    print ()
    print(".", end="")
    for i in range(len(string)):
        print(".#..", end="")
    print()

