t=open(0).read();print((('P'*(t.count('#')<sum(map(int,t.split()[:2])))or'Imp')+'ossible'))
t=open(0).read();print(('I mPp'[t.count('#')<int(t[0])+int(t[2])::2]+'ossible'))
t = open(0).read()
print((("P" * (t.count("#") < sum(map(int, t.split()[:2]))) or "Imp") + "ossible"))

t = open(0).read()
print(("I mPp"[t.count("#") < int(t[0]) + int(t[2]) :: 2] + "ossible"))

-print((("P" * (t.count("#") < sum(map(int, t.split()[:2]))) or "Imp") + "ossible")) +print(("I mPp"[t.count("#") < int(t[0]) + int(t[2]) :: 2] + "ossible"))