h, w = list(map(int, input().split()))

s = h + w - 1

x = 0

for _ in range(h):

	x += input().count("#")



if s == x:

	print("Possible")

else:

	print("Impossible")
h, w = list(map(int, input().split()))

cnt = 0

for _ in range(h):

    cnt += input().count("#")



if cnt == h+w-1:

    print("Possible")

else:

    print("Impossible")
h, w = list(map(int, input().split()))
s = h + w - 1
x = 0
for _ in range(h):
    x += input().count("#")
if s == x:
    print("Possible")
else:
    print("Impossible")

h, w = list(map(int, input().split()))
cnt = 0
for _ in range(h):
    cnt += input().count("#")
if cnt == h + w - 1:
    print("Possible")
else:
    print("Impossible")

-s = h + w - 1 -x = 0 +cnt = 0 -    x += input().count("#") -if s == x: +    cnt += input().count("#") +if cnt == h + w - 1: