N, M = list(map(int, input().split()))

G = [set() for _ in range(N)]



for i in range(M):

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

    a -= 1

    b -= 1

    G[a].add(b)

    G[b].add(a)



for g in G[N - 1]:

    if g in G[0]:

        print("POSSIBLE")

        exit()



print("IMPOSSIBLE")

N, M = list(map(int, input().split()))

G = [set() for _ in range(N)]



for i in range(M):

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

    a -= 1

    b -= 1

    G[a].add(b)

    G[b].add(a)



if len(G[N - 1] & G[0]) > 0:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
G = [set() for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    G[a].add(b)
    G[b].add(a)
for g in G[N - 1]:
    if g in G[0]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
G = [set() for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    G[a].add(b)
    G[b].add(a)
if len(G[N - 1] & G[0]) > 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-for g in G[N - 1]: -    if g in G[0]: -        print("POSSIBLE") -        exit() -print("IMPOSSIBLE") +if len(G[N - 1] & G[0]) > 0: +    print("POSSIBLE") +else: +    print("IMPOSSIBLE")