Harryxun/stf_run huggingface dataset:
N,K = map(str, input().split())
if N % K != 0:
  print(1)
else:
  print(0)

### FIXED CODE ###

N,K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)
S = int(input()).sort()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

S = sorted(list(input()))
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('Yes')
else:
    print('No')
strList = list(input())
intList = [int(s) for s in strList]
if sum(intList)%9 == 0:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

strList = list(input())
intList = [int(s) for s in strList]
if sum(intList)%9 == 0:
  print("Yes")
else:
  print("No")
mport sys
 
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
 
NUM = 20005
 
table = [""]*NUM
 
 
while True:
 
    T = str(input())
    if T == '-':
        break
 
    left = 0
    right = 0
    #長い配列にパターン文字列を転記
    for i in range(len(T)):
        # print(T[right])
        table[left+right] = T[right]
        right += 1
 
    num_suffle = int(input())
 
    for loop in range(num_suffle):
        pick_num = int(input())
        #先頭からpick_num文字を末尾に転記し、論理削除
        for i in range(pick_num):
            table[right+i] = table[left+i]
        left += pick_num
        right += pick_num
 
    for i in range(left,right):
        print("%s"%(table[i]),end = "")
    print()


### FIXED CODE ###

import sys
 
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
 
NUM = 20005
 
table = [""]*NUM
 
 
while True:
 
    T = str(input())
    if T == '-':
        break
 
    left = 0
    right = 0
    #長い配列にパターン文字列を転記
    for i in range(len(T)):
        # print(T[right])
        table[left+right] = T[right]
        right += 1
 
    num_suffle = int(input())
 
    for loop in range(num_suffle):
        pick_num = int(input())
        #先頭からpick_num文字を末尾に転記し、論理削除
        for i in range(pick_num):
            table[right+i] = table[left+i]
        left += pick_num
        right += pick_num
 
    for i in range(left,right):
        print("%s"%(table[i]),end = "")
    print()
M = 1000000007

from fractions import Fraction
from bisect import bisect_left

N = int(input())

fish_list = []
for _ in range(N):
	a, b = map(int, input().split())
	fish_list.append(Fraction(a, b))

#print(fish_list)

fish_table = {}
for f in fish_list:
	if f in fish_table:
		fish_table[f] += 1
	else:
		fish_table[f] = 1

fish_count_list = list(fish_table.items())
fish_count_list.sort()
fish_count_only_list = [f for f, c in fish_count_list]

#print(fish_count_list)

singles = 0
pair_list = []
checked = [False] * N

for i, (f, c) in enumerate(fish_count_list):
	x = -1 / f
	j = bisect_left(fish_count_only_list, x)
	if j != len(fish_count_only_list) and fish_count_only_list[j] == x:
		if checked[j] == False:
			f2, c2 = fish_count_list[j]
			pair_list.append((c, c2))
			checked[i] = True
	else:
		singles += 1

count = pow(2, singles, M)

for c1, c2 in pair_list:
	count = (count * (pow(2, c1, M) + pow(2, c2, M) - 1)) % M

count -= 1

print(count)


### FIXED CODE ###

M = 1000000007

import math

N = int(input())

ab_zero_count = 0
a_zero_count = 0
b_zero_count = 0

fish_list = []
for _ in range(N):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		ab_zero_count += 1
	elif a == 0:
		a_zero_count += 1
	elif b == 0:
		b_zero_count += 1
	else:
		if a < 0:
			a = -a
			b = -b
		g = math.gcd(a, b)
		if g > 1:
			a //= g
			b //= g
		fish_list.append((a, b))

#print(fish_list)

fish_table = {}
for f in fish_list:
	if f in fish_table:
		fish_table[f] += 1
	else:
		fish_table[f] = 1

fish_count_list = list(fish_table.items())
fish_index_table = {}
for i, (f, c) in enumerate(fish_count_list):
	fish_index_table[f] = i

#print(fish_count_list)

singles = 0
pair_list = []
checked = [False] * N

for i, (f, c) in enumerate(fish_count_list):
	a, b = f
	a, b = (-b, a)
	if a < 0:
		a = -a
		b = -b
	key = (a, b)
	if key in fish_index_table:
		j = fish_index_table[key]
		if checked[j] == False:
			f2, c2 = fish_count_list[j]
			pair_list.append((c, c2))
			checked[i] = True
	else:
		singles += c

if a_zero_count > 0 and b_zero_count > 0:
	pair_list.append((a_zero_count, b_zero_count))
else:
	singles += a_zero_count + b_zero_count

count = pow(2, singles, M)

#print(singles, pair_list, a_zero_count, b_zero_count)

for c1, c2 in pair_list:
	count = (count * (pow(2, c1, M) + pow(2, c2, M) - 1)) % M

count += ab_zero_count
count -= 1

print(count % M)
import itertools

def findRoot(uf,value):
  if uf[value]==None:
    return value
  else:
    uf[value]=findRoot(uf,uf[value])
    return uf[value]

n,m=[int(x) for x in input().split(' ')]

uf=[None]*n
b=[]
s=[1]*n
r=[]

for x in range(0,m):
  b.append([int(x)-1 for x in input().split(' ')])

for x in b[::-1]:
  r1=findRoot(uf,x[0])
  r2=findRoot(uf,x[1])

  if r1==r2:
    r.append(0)
  else:
    r.append(s[r1]*s[r2])
#木の結合
    if s[r1]<s[r2]:
      uf[r2]=r1
      s[r1]+=s[r2]
    else
      uf[r1]=r2
      s[r2]+=s[r1]


for x in itertools.accumulate(r[::-1]):
  print(x)

### FIXED CODE ###

import itertools
import sys

def findRoot(uf,value):
  if uf[value]==None:
    return value
  else:
#経路圧縮
    uf[value]=findRoot(uf,uf[value])
    return uf[value]


sys.setrecursionlimit(50000)
n,m=[int(x) for x in input().split(' ')]

uf=[None]*n
b=[]
s=[1]*n
r=[]

for x in range(0,m):
  b.append([int(x)-1 for x in input().split(' ')])

for x in b[::-1]:
  r1=findRoot(uf,x[0])
  r2=findRoot(uf,x[1])

  if r1==r2:
    r.append(0)
  else:
    r.append(s[r1]*s[r2])
#木の結合
    uf[r2]=r1
    s[r1]+=s[r2]

for x in itertools.accumulate(r[::-1]):
  print(x)
from operator import itemgetter
from queue import deque

N = int(input())

xin = []
yin = []

for _ in range(N):
    x, y = map(int, input().split())
    xin.append(x)
    yin.append(y)
    
xin = sorted(list(enumerate(xin)), key=itemgetter(1))
yin = sorted(list(enumerate(yin)), key=itemgetter(1))

xd = []
yd = []

for i in range(N-1):
    xd.append((xin[i+1][1] - xin[i][1], (xin[i][0], xin[i+1][0])))
    yd.append((yin[i+1][1] - yin[i][1], (yin[i][0], yin[i+1][0])))
    
xdq = deque(sorted(xd))
ydq = deque(sorted(yd))

par = list(range(N))

def find(x):
    if x == par[x]:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
    
    
def union(x, y):
    px, py = find(x), find(y)
    if px != py:
        par[px] = py
    
ans = 0

while xdq or ydq:
    if xdq and (not ydq or xdq[0] < ydq[0]):
        d, (i, j) = xdq.popleft()
    else:
        d, (i, j) = ydq.popleft()
        
    if find(i) != find(j):
        ans += d
        union(i, j)
        
print(ans)

### FIXED CODE ###

from operator import itemgetter
from queue import deque

N = int(input())

xin = []
yin = []

for _ in range(N):
    x, y = map(int, input().split())
    xin.append(x)
    yin.append(y)
    
xin = sorted(list(enumerate(xin)), key=itemgetter(1))
yin = sorted(list(enumerate(yin)), key=itemgetter(1))

xd = []
yd = []

for i in range(N-1):
    xd.append((xin[i+1][1] - xin[i][1], (xin[i][0], xin[i+1][0])))
    yd.append((yin[i+1][1] - yin[i][1], (yin[i][0], yin[i+1][0])))
    
xdq = deque(sorted(xd))
ydq = deque(sorted(yd))

par = list(range(N))

def find(x):
    if x == par[x]:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
    
    
def union(x, y):
    px, py = find(x), find(y)
    if px != py:
        par[py] = px
    
ans = 0

while xdq or ydq:
    if xdq and (not ydq or xdq[0] < ydq[0]):
        d, (i, j) = xdq.popleft()
    else:
        d, (i, j) = ydq.popleft()
        
    if find(i) != find(j):
        ans += d
        union(i, j)
        
print(ans)
a,b,c = map(int,input())

if a == b != c or b == c != a or c == a != b:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

if a == b != c or b == c != a or c == a != b:
    print('Yes')
else:
    print('No')
s = input();print("ABC"*s==ARC or "ARC")

### FIXED CODE ###

s = input()
if s[1] == "R":
  print("ABC")
else:
  print("ARC")
import bisect

n = int(input())
l = list(map(int,input().split()))
l.sort()
count = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        short_2hen = l[i] + l[j]
        l_long = l[j+1:n]
        bis = bisect.bisect_right(l_long, short_2hen-1)
        count += bis
        print(l_long)
        print(bis)
print(count)


### FIXED CODE ###

import bisect

n = int(input())
l = list(map(int,input().split()))
l.sort()
count = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        short_2hen = l[i] + l[j]
        bis = bisect.bisect_left(l, short_2hen)
        count += bis - j - 1
print(count)
s=input()
print(a[0]+str(len(s)-2)+s[-1])

### FIXED CODE ###

s=input()
print(s[0]+str(len(s)-2)+s[-1])
print("Impossible" if sum(map(int, input)) % 3 else "Possible")


### FIXED CODE ###

A, B = map(int, input().split())
if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")
def dfs(start, edges, n_nodes):
    node_values = [0 for _ in range(n_nodes)]
    not_visited = set(range(n_nodes))

    # start node
    not_visited.remove(start)

    # not connected nodes
    not_connected_nodes = set([node for node, connected in edges.items()
                               if len(connected) == 0])
    not_visited -= not_connected_nodes

    if start in not_connected_nodes:
        return True

    next_node_candidates = {start}
    while not_visited:
        curr_node = next_node_candidates.pop()

        connected_nodes = edges[curr_node].keys()
        for c in connected_nodes:
            if c in not_visited:
                next_node_candidates |= {c}
                not_visited.remove(c)
                node_values[c] = node_values[curr_node] + edges[curr_node][c]

    # validate edges
    for e1, e2_and_d in edges.items():
        for e2, d in e2_and_d.items():
            if edges[e1][e2] != node_values[e2] - node_values[e1]:
                return False

    # all edges are valid: return True
    return True


if __name__ == '__main__':
    N, M = map(int, input().split())
    if M == 0:
        print("Yes")
        exit(0)

    Ls, Rs, Ds = zip(*[list(map(int, input().split())) for _ in range(M)])

    # N, M = 10, 3
    # Ls, Rs, Ds = zip(*[[8, 7, 100],
    #                    [7, 9, 100],
    #                    [9, 8, 100]])

    edges = {i: dict() for i in range(N)}
    # visited = [None] * N
    for L, R, D in zip(Ls, Rs, Ds):
        edges[L - 1][R - 1] = D
        edges[R - 1][L - 1] = -D

    for start in range(N):
        is_valid = dfs(start, edges, N)
        if not is_valid:
            print("No")
            exit(0)

    print("Yes")


### FIXED CODE ###

import sys

sys.setrecursionlimit(200002)


def dfs(start, edges, nodes):
    for adj_node, distance in edges[start].items():
        # まだ訪れていない隣接ノード
        if nodes[adj_node] is None:
            nodes[adj_node] = nodes[start] + distance
            # adj_nodeを開始位置にしてまだ訪れていないノードを探索する
            # 探索中にノード値とエッジの関係性が一致しなくなればFalse
            if not dfs(adj_node, edges, nodes):
                return False
        # 既に訪れた隣接ノード
        else:
            if nodes[adj_node] - nodes[start] != distance:
                return False

    return True


if __name__ == '__main__':
    N, M = map(int, input().split())
    if M == 0:
        print("Yes")
        exit(0)

    Ls, Rs, Ds = zip(*[list(map(int, input().split())) for _ in range(M)])

    # N, M = 10, 3
    # Ls, Rs, Ds = zip(*[[8, 7, 100],
    #                    [7, 9, 100],
    #                    [9, 8, 100]])

    edges = {i: dict() for i in range(N)}

    for L, R, D in zip(Ls, Rs, Ds):
        edges[L - 1][R - 1] = D
        edges[R - 1][L - 1] = -D

    nodes = [None] * N

    valid_list = []
    for start in range(N):
        if nodes[start] is None:
            nodes[start] = 0
            # ノード値とエッジの関係性が一致しなくなればfalse
            valid_list.append(dfs(start, edges, nodes))

    if all(valid_list):
        print("Yes")
    else:
        print("No")
i=0
while 1
    x,y = map(int,input().split())
    if x==0 or y==0;
        break

    n=[x,y]
    n.sort()
    print n
    i+=1

### FIXED CODE ###

while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]
n=input()
h,r1=n//3600,n%3600
m,s=r1//60,r1%60
print("h:m:s")

### FIXED CODE ###

S=int(input())
print(S//3600,(S%3600)//60,S%60,sep=":")
import sys

def my_index(l, x):
    if x in l:
        return l.index(x)
    else:
        return -1

input = sys.stdin.readline
n,m = map(int, input().split())
A = list(map(int,input().split()))
d = {}
for i in range(m):
    b,c = map(int, input().split())
    if d.get(c) == None:
        d[c] = b
    else:
        d[c] = d[c] + b

for c, b in sorted(d.items(), key=lambda x: -x[0]):
    A.sort()
    if b > n:
        b = n

    if A[0] < c:
        if A[b] > c:
            for i in range(A):
                if i // c == 0:
                    f = i
                else:
                    break
            A[:f]=[c]*f
        else:
            A[:b]=[c]*b


print(sum(A))


### FIXED CODE ###

import sys
import heapq

input = sys.stdin.readline
n,m = map(int, input().split())
A = list(map(int,input().split()))
d = [list(map(int,input().split())) for _ in range(m)]

d.sort(key=lambda x:-x[1])
total = sum(A)
heapq.heapify(A)

for i in range(m):
    for j in range(d[i][0]):
        tmp = heapq.heappushpop(A, d[i][1])
        if tmp < d[i][1]:
                total += (d[i][1] - tmp)
        else:
            break

print(total)
if __name__ == '__main__':
	a, b, c = map(int, input().split())
	sq = math.sqrt(a*b)
	if 2 * sq < (c - a - b) :
		print('Yes')
	else:
		print('No')

### FIXED CODE ###

import math

if __name__ == '__main__':
	a, b, c = map(int, input().split())
	if 4 * a * b < (c - a - b)**2 and c-a-b>0:
		print('Yes')
	else:
		print('No')
def len_LCS(X,Y):
    D = {}
    def main(X,Y):
        if len(X) == 0: return 0
        if (X,Y) in D: return D[(X,Y)]
        if len(X) == 1:
            D[(X,Y)] = 1 if X[0] in Y else 0
        elif X[0] in Y:
            if Y.index(X[0]) == len(Y)-1:
                D[(X,Y)] = max(1,main(X[1:],Y[:])) 
            else: 
                D[(X,Y)]=  max(main(X[1:],Y[Y.index(X[0])+1:]) + 1,\
                               main(X[1:],Y[:]))
        else:
             D[(X,Y)] = main(X[1:],Y[:]) 
        return D[(X,Y)]
    return main(X,Y)
        
if __name__=='__main__':
    n = int(input())
    for _ in range(n):
        X = input()
        Y = input()
        print(len_LCS(X,Y))

### FIXED CODE ###

def len_LCS(X,Y):
    lcs_row = [0 for _ in range(len(X)+1)]
    for yc in Y:
        lcs_row_p = lcs_row[:]
        # lcs_row_p: [i] [i+1]
        # lcs_row  : [i] [i+1]
        for (i,xc) in enumerate(X):
            if xc == yc:
                lcs_row[i+1] = lcs_row_p[i] + 1
            elif lcs_row[i] > lcs_row_p[i+1]:
                lcs_row[i+1] = lcs_row[i]
    return lcs_row[-1]
        
if __name__=='__main__':
    n = int(input())
    for _ in range(n):
        X = input()
        Y = input()
        print(len_LCS(X,Y))
a = map(int, stdin.readline().split())
a.sort()
def f(j, t):
    global n
    for i in xrange(j, n):
        if a[i] != a[j]:
            break
    else:
        i = n
    x = (a[j] - t) & 1
    y = (i - j) & 1
    if i == n:
        return x ^ y
    elif (a[j] - t) == 1:
        return not f(i, a[j])
    else:
        return x ^ y ^ ((n - i) & 1)
print "First" if f(0, 0) else "Second"


### FIXED CODE ###

from sys import stdin
from collections import deque
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
f = 1
q = deque(a)
t = 1
while 1:
    if len(q) == 1:
        f = (q[0] - t + 1) & 1 ^ 1
        break
    if t == q[0] == q[-1]:
        f = len(q) & 1 ^ 1
        break
    x = q.pop()
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.append(x)
    while q and q[0] == t:
        q.popleft()
    t += 1
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.pop()
    if not q:
        f = 0
        break
print "First" if f else "Second"
#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, x: "List[int]", y: "List[int]"):
    rem = {}
    for i in range(N-1):
        for j in range(i + 1, N):
            dx = x[i] - x[j]
            dy = y[i] - y[j]

            found = False
            for dx2, dy2  in rem.keys():
                if dx * dy2 == dy * dx2:
                    rem[(dx2, dy2)].add(j)
                    found = True
            if not found:
                rem[(dx, dy)] = set()
                rem[(dx, dy)].add(j)
    
    return N - max([len(v) for k, v in rem.items()])


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]" 
    y = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    result = solve(N, x, y)
    print(result)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, x: "List[int]", y: "List[int]"):
    ds = []
    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            dx = x[j] - x[i]
            dy = y[j] - y[i]
            ds.append((dx, dy))

    return 1 if N == 1 else (N - max(Counter(ds).values()))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]" 
    y = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    result = solve(N, x, y)
    print(result)

if __name__ == '__main__':
    main()
N, K = map(int, input().split())
P = list(map(int, input().split()))

cml_sum = [(P[0]+1)/2.0]
for i in range(1, N):
    cml_sum.append(cml_sum[i-1] + (P[i]+1)/2.0)

ans = cml_sum[K]
for i in range(N-K):
    target = cml_sum[i+K] - cml_sum[i]
    if ans < target:
        ans = target

print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
P = list(map(int, input().split()))

cml_sum = [(P[0]+1)/2.0]
for i in range(1, N):
    cml_sum.append(cml_sum[i-1] + (P[i]+1)/2.0)

ans = cml_sum[K-1]
for i in range(N-K):
    target = cml_sum[i+K] - cml_sum[i]
    if ans < target:
        ans = target

print(ans)
if N>=189:
    print(3)
elif N>=165:
    print(2)
elif N>=105:
    print(1)
else:
    print(0)  

### FIXED CODE ###

N=int(input())
if N>=195:
    print(5)
elif N>=189:
    print(4)
elif N>=165:
    print(3)
elif N>=135:
    print(2)
elif N>=105:
    print(1)
else:
    print(0)
N, K, X, Y, = map(int, input().split())

# 高橋くんの宿泊数 N
# 宿泊費が変わる　 K
# 初期宿泊費      X
# K+1以降の宿泊費 Y

# subは宿泊数の超過分
sub = N - K

# もしNよりKが大きい場合、そのまま計算する
if N <= K:
    answer = N * X
    print(answer)
# KよりNが大きい場合 K * X + (N - K) * Y
else:
    answer = K * X + sub * Y
    print(answer)


### FIXED CODE ###

N = int(input())    # 宿泊数
K = int(input())    # 単価が切り替わる泊数
X = int(input())    # 単価a
Y = int(input())    # 単価b


if N <= K:
    a = N * X
else:
    a = K * X + Y * (N - K)

print(a)
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if(e - a >= k):
  print(":(")
  else:
    print("Yai!")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if(e - a > k):
  print(":(")
else:
  print("Yay!")
N,M = map(int,input().split())
if N = M:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
a = c1[0]+c2[1]+c3[2]
b = c1[1]+c2[2]+c3[0]
c = c1[2]+c2[0]+c3[1]
d = c1[0]+c2[2]+c3[1]
e = c1[1]+c2[0]+c3[2]
f = c1[2]+c2[1]+c3[0]
if a=b and b=c and c=d and d=e and e=f:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
a = c1[0]+c2[1]+c3[2]
b = c1[1]+c2[2]+c3[0]
c = c1[2]+c2[0]+c3[1]
d = c1[0]+c2[2]+c3[1]
e = c1[1]+c2[0]+c3[2]
f = c1[2]+c2[1]+c3[0]
if a==b==c==d==e==f:
  print('Yes')
else:
  print('No')
n,m=map(int,input().split())
tr=[[] for i in range(m)]
for i in range(m):
  a,b=map(int,input().split())
  if a!=1 and b!=n:
    continue
  tr[a].append(b)
  tr[b].append(a)
for i in range(m):
  if len(tr[m])==2:
    print("POSSIBLE")
    break
else:
  print("IMPOSSIBLE")

### FIXED CODE ###

n,m=map(int,input().split())
tr=[[] for i in range(n+1)]
for i in range(m):
  a,b=map(int,input().split())
  if a!=1 and b!=n:
    continue
  tr[a].append(b)
  tr[b].append(a)
for i in range(2,n):
  if len(tr[i])==2:
    print("POSSIBLE")
    break
else:
  print("IMPOSSIBLE")
import math
targ = int(input())
while True:
    minans = float("inf")
    if (targ ** ( 1 / 3)) == int(targ ** ( 1 / 3)):
        z = int(targ ** ( 1 / 3))
        targ = 0
    elif (targ ** ( 1 / 2)) == int(targ ** ( 1 / 2)):
        y = int(targ ** ( 1 / 2))
        targ = 0
    else:
        for n in range(math.ceil(targ ** ( 1 / 3))):
            if minans == 0:
                break
            for m in range(math.ceil(targ ** ( 1 / 2))):
                if (n ** 3) + (m **2) > targ:
                    break
                if minans > targ - (n ** 3 + m ** 2) + n + m:
                    minans = targ - (n ** 3 + m ** 2) + n + m
    if minans != float("inf"):
        print(minans)
    else:
        print(y + z)
    targ = int(input())
    if targ == 0:
        break
         

### FIXED CODE ###

import math
targ = int(input())
y,z = 0,0
while True:
    minans = float("inf")
    for n in range(math.ceil(targ ** ( 1 / 3))+1):
        if minans == 0:
            break
        if targ - n**3 >= 0:
            m = int((targ - n**3) **(1/2))
        else:
            m = 0
        if (n ** 3) + (m **2) > targ:
            break
        if minans > targ - (n ** 3 + m**2) + n + m:
            minans = targ - (n ** 3 + m**2) + n + m
    if minans != float("inf"):
        print(minans)
    else:
        print(y + z)
    targ = int(input())
    if targ == 0:
        break
N = int(input())
L = list(range(1, N + 1))
print(sum(L[:-1]))

### FIXED CODE ###

N = int(input())
if N % 2 == 0:
    print(int(N/2) * (N-1))
else:
    print(int((N-1)/2) * N)
# -*- coding: utf-8 -*-

a, b, c, d = map(int, input().slice())

while True:
  c -= b
  if c <=0:
    print('Yes')
    break
  a -= d
  if a <= 0:
    print('No')
    break

### FIXED CODE ###

# -*- coding: utf-8 -*-

a, b, c, d = map(int, input().split())

while True:
  c -= b
  if c <= 0:
    print('Yes')
    break
  
  a -= d
  if a <= 0:
    print('No')
    break