n, m = list(map(int, input().split()))



p = set()

q = set()



for _ in range(m):

    a, b = list(map(int, input().split()))

    if a == 1:

        p.add(b)

    elif b == n:

        q.add(a)

else:

    print(("POSSIBLE" if p & q else "IMPOSSIBLE"))
n, m = input().split()



p = set()

q = set()

for _ in range(int(m)):

    a, b = input().split()

    if a == "1":

        p.add(b)

    elif b == n:

        q.add(a)

else:

    if p & q:

        print("POSSIBLE")

    else:

        print("IMPOSSIBLE")
n, m = list(map(int, input().split()))
p = set()
q = set()
for _ in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        p.add(b)
    elif b == n:
        q.add(a)
else:
    print(("POSSIBLE" if p & q else "IMPOSSIBLE"))

n, m = input().split()
p = set()
q = set()
for _ in range(int(m)):
    a, b = input().split()
    if a == "1":
        p.add(b)
    elif b == n:
        q.add(a)
else:
    if p & q:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

-n, m = list(map(int, input().split())) +n, m = input().split() -for _ in range(m): -    a, b = list(map(int, input().split())) -    if a == 1: +for _ in range(int(m)): +    a, b = input().split() +    if a == "1": -    print(("POSSIBLE" if p & q else "IMPOSSIBLE")) +    if p & q: +        print("POSSIBLE") +    else: +        print("IMPOSSIBLE")