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

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



ans = 0

for i in range(H):

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

print(("Possible" if ans == H + W - 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 = [list(eval(input())) for _ in range(H)]
ans = 0
for i in range(H):
    ans += A[i].count("#")
print(("Possible" if ans == H + W - 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"))

-ans = 0 +cnt = 0 -    ans += A[i].count("#") -print(("Possible" if ans == H + W - 1 else "Impossible")) +    cnt += A[i].count("#") +print(("Possible" if cnt == H + W - 1 else "Impossible"))