H, W = list(map(int, input().split()))

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



cnt = 0

for i in range(H):

  cnt += A[i].count("#")

print(("Possible" if cnt == H + W - 1 else "Impossible"))
H,W = list(map(int, input().split()))

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



cnt = 0

for a in A:

    cnt += a.count("#")

print(("Possible" if cnt == W + (H-1) else "Impossible"))
H, W = list(map(int, input().split()))
A = [list(eval(input())) for _ in range(H)]
cnt = 0
for i in range(H):
    cnt += A[i].count("#")
print(("Possible" if cnt == H + W - 1 else "Impossible"))

H, W = list(map(int, input().split()))
A = [eval(input()) for _ in range(H)]
cnt = 0
for a in A:
    cnt += a.count("#")
print(("Possible" if cnt == W + (H - 1) else "Impossible"))

-A = [list(eval(input())) for _ in range(H)] +A = [eval(input()) for _ in range(H)] -for i in range(H): -    cnt += A[i].count("#") -print(("Possible" if cnt == H + W - 1 else "Impossible")) +for a in A: +    cnt += a.count("#") +print(("Possible" if cnt == W + (H - 1) else "Impossible"))