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

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

endSh = 0

for i in S:

  startSh = i.find("#")

  if startSh != endSh:

    print("Impossible")

    exit()

  endSh = i.rfind("#")

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

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



sp = 0

for line in A:

  if line.find("#") != sp:  

    print("Impossible")

    exit()

  sp = line.rfind("#")

print("Possible")
H, W = list(map(int, input().split()))
S = [eval(input()) for _ in range(H)]
endSh = 0
for i in S:
    startSh = i.find("#")
    if startSh != endSh:
        print("Impossible")
        exit()
    endSh = i.rfind("#")
print("Possible")

h, w = list(map(int, input().split()))
A = [eval(input()) for _ in range(h)]
sp = 0
for line in A:
    if line.find("#") != sp:
        print("Impossible")
        exit()
    sp = line.rfind("#")
print("Possible")

-H, W = list(map(int, input().split())) -S = [eval(input()) for _ in range(H)] -endSh = 0 -for i in S: -    startSh = i.find("#") -    if startSh != endSh: +h, w = list(map(int, input().split())) +A = [eval(input()) for _ in range(h)] +sp = 0 +for line in A: +    if line.find("#") != sp: -    endSh = i.rfind("#") +    sp = line.rfind("#")