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

s = [[] for i in range(N+1)]

e = [[] for i in range(N+1)]

for i in range(M):

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

    s[a].append(b)

    e[b].append(a)



for i in s[1]:

    if N in s[i]:

        print('POSSIBLE')

        exit()



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

s = [[] for i in range(N+1)]

for i in range(M):

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

    s[a].append(b)



for i in s[1]:

    if N in s[i]:

        print('POSSIBLE')

        exit()



print('IMPOSSIBLE')
N, M = list(map(int, input().split()))
s = [[] for i in range(N + 1)]
e = [[] for i in range(N + 1)]
for i in range(M):
    a, b = list(map(int, input().split()))
    s[a].append(b)
    e[b].append(a)
for i in s[1]:
    if N in s[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
s = [[] for i in range(N + 1)]
for i in range(M):
    a, b = list(map(int, input().split()))
    s[a].append(b)
for i in s[1]:
    if N in s[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

-e = [[] for i in range(N + 1)] -    e[b].append(a)