H,W = [int(i) for i in input().split()]

li = [list(eval(input())) for _ in range(H)]



flag = 0

for i in range(H):

    tmp = []

    for j,k in enumerate(li[i]):

        if k == '#':

            tmp.append(j)

    if i != 0 and p != tmp[0]:

        flag = 1

        break

    p = tmp[-1]



print((['Possible', 'Impossible'][flag]))

H,W = [int(zz) for zz in input().split()]

map = [list(eval(input())) for _ in range(H)]



r = 0

for j in range(W):

    if map[0][j] == "#":

        r = j

for i in range(1,H):

    flag = 1

    for j in range(W):

        if flag and map[i][j] == "#":

            if r != j:

                print('Impossible')

                exit()

            flag = 0

        elif map[i][j] == "#":

            r = j



print('Possible')

H, W = [int(i) for i in input().split()]
li = [list(eval(input())) for _ in range(H)]
flag = 0
for i in range(H):
    tmp = []
    for j, k in enumerate(li[i]):
        if k == "#":
            tmp.append(j)
    if i != 0 and p != tmp[0]:
        flag = 1
        break
    p = tmp[-1]
print((["Possible", "Impossible"][flag]))

H, W = [int(zz) for zz in input().split()]
map = [list(eval(input())) for _ in range(H)]
r = 0
for j in range(W):
    if map[0][j] == "#":
        r = j
for i in range(1, H):
    flag = 1
    for j in range(W):
        if flag and map[i][j] == "#":
            if r != j:
                print("Impossible")
                exit()
            flag = 0
        elif map[i][j] == "#":
            r = j
print("Possible")

-H, W = [int(i) for i in input().split()] -li = [list(eval(input())) for _ in range(H)] -flag = 0 -for i in range(H): -    tmp = [] -    for j, k in enumerate(li[i]): -        if k == "#": -            tmp.append(j) -    if i != 0 and p != tmp[0]: -        flag = 1 -        break -    p = tmp[-1] -print((["Possible", "Impossible"][flag])) +H, W = [int(zz) for zz in input().split()] +map = [list(eval(input())) for _ in range(H)] +r = 0 +for j in range(W): +    if map[0][j] == "#": +        r = j +for i in range(1, H): +    flag = 1 +    for j in range(W): +        if flag and map[i][j] == "#": +            if r != j: +                print("Impossible") +                exit() +            flag = 0 +        elif map[i][j] == "#": +            r = j +print("Possible")