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

edg=[[] for i in range(n+1)]

for i in range(m):

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

    edg[a].append(b)

    edg[b].append(a)

f=1

for i in range(2,n+1):

    if 1 in edg[i] and n in edg[i]:

        f=0

print(("POSSIBLE" if f==0 else "IMPOSSIBLE"))

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

edg1=[0]*(n+1)

edgn=[0]*(n+1)

for i in range(m):

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

    if a==1:

        edg1[b]=1

    if b==n:

        edgn[a]=1



f=1

for i in range(2,n+1):

    if edg1[i]==1 and edgn[i]==1:

        f=0

print(("POSSIBLE" if f==0 else "IMPOSSIBLE"))

n, m = list(map(int, input().split()))
edg = [[] for i in range(n + 1)]
for i in range(m):
    a, b = list(map(int, input().split()))
    edg[a].append(b)
    edg[b].append(a)
f = 1
for i in range(2, n + 1):
    if 1 in edg[i] and n in edg[i]:
        f = 0
print(("POSSIBLE" if f == 0 else "IMPOSSIBLE"))

n, m = list(map(int, input().split()))
edg1 = [0] * (n + 1)
edgn = [0] * (n + 1)
for i in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        edg1[b] = 1
    if b == n:
        edgn[a] = 1
f = 1
for i in range(2, n + 1):
    if edg1[i] == 1 and edgn[i] == 1:
        f = 0
print(("POSSIBLE" if f == 0 else "IMPOSSIBLE"))

-edg = [[] for i in range(n + 1)] +edg1 = [0] * (n + 1) +edgn = [0] * (n + 1) -    edg[a].append(b) -    edg[b].append(a) +    if a == 1: +        edg1[b] = 1 +    if b == n: +        edgn[a] = 1 -    if 1 in edg[i] and n in edg[i]: +    if edg1[i] == 1 and edgn[i] == 1: