Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3
import sys
import bisect


def solve(X: int, N: int, p: "List[int]"):
    sortp = sorted(p)
    if(N == 0):
        print(X)
        exit()

    for i in range(100):
        # 左側
        l = X - i
        index = bisect.bisect_left(sortp,l)
        if(sortp[index] != l):
            print(l)
            exit()

        # 右側
        r = X + i
        index = bisect.bisect_left(sortp,r)
        if(sortp[index] != r):
            print(r)
            exit()

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    p = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(X, N, p)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import bisect


def solve(X: int, N: int, p: "List[int]"):
    sortp = sorted(p)
    if(N == 0):
        print(X)
        exit()

    for i in range(100):
        # 左側
        l = X - i
        index = bisect.bisect_left(sortp,l)
        if(index == N or sortp[index] != l):
            print(l)
            exit()

        # 右側
        r = X + i
        index = bisect.bisect_left(sortp,r)
        if(index == N or sortp[index] != r):
            print(r)
            exit()

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    p = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(X, N, p)

if __name__ == '__main__':
    main()
N = input()
print("No" if N % sum(int(x) for x in N) else "Yes")

### FIXED CODE ###

N = input()
print("No" if int(N) % sum(int(x) for x in N) else "Yes")
n,m = list(map(int, input().split(" ")))

A = list(map(int, input().split(" ")))
bc = []
for _ in range(m):
  b,c = list(map(int, input().split(" ")))
  bc.append((b,c))

count = 0
bc = sorted(bc,key=lambda x:x(1),reverse = True)
big_list = []
for b,c in bc:
  big_list += [c for _ in range(b)]
  count += b
  if count >= N:
    break
print(sum( sorted((A+big_list),reverse=True)[:N] ))

### FIXED CODE ###

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

A = list(map(int, input().split(" ")))
bc = []
for _ in range(m):
  b,c = list(map(int, input().split(" ")))
  bc.append((b,c))

count = 0
bc = sorted(bc,key=lambda x:x[1],reverse = True)
big_list = []
for b,c in bc:
  big_list += [c for _ in range(b)]
  count += b
  if count >= n:
    break
print(sum( sorted((A+big_list),reverse=True)[:n] ))
s=list(input())
a=0
for i in range(s):
    if s[i]=='1':
        a=a+1

print(a)



### FIXED CODE ###

s=input()
a=0
for i in range(len(s)):
    if s[i]=="1":
        a=a+1

print(a)
'''input
3 3
...
...
...
'''
# A coding delight
from sys import stdin, stdout
import gc
gc.disable()
input = stdin.readline
from collections import deque


def mp(arr):
	arr = map(str, arr)
	return ' '.join(arr)


def bfs(source):
	myq = deque()
	myq.append(source)
	visited = dict()
	visited[mp(source)] = True
	dist = -1
	while len(myq) > 0:
		temp = deque()
		dist += 1
		while len(myq) > 0:
			x, y  = myq.popleft()
			if x - 1 >= 0 and maze[x - 1][y] != '#' and mp([x - 1, y]) not in visited:
				visited[mp([x -1, y])] = True
				temp.append([x - 1, y])
			if x  + 1 < n and maze[x + 1][y] != '#' and mp([x + 1, y]) not in visited:
				visited[mp([x + 1, y])] = True
				temp.append([x + 1, y])
			if y - 1 >= 0 and maze[x][y - 1] != '#' and mp([x, y - 1]) not in visited:
				visited[mp([x, y - 1])] = True
				temp.append([x, y - 1])
			if y + 1 < m and maze[x][y + 1] != '#' and mp([x, y + 1]) not in visited:
				visited[mp([x, y + 1])] = True
				temp.append([x, y + 1])
		myq = temp
	return dist		


# main starts
n, m = list(map(int, input().split()))
maze = []
for _ in range(m):
	state = list(stdin.readline().strip())
	maze.append(state)

# from random import randint
# maze = []
# n = 20
# m = 20
# for i in range(20):
# 	temp = []
# 	for i in range(20):
# 		k = randint(1, 2)
# 		if k == 1:
# 			temp.append('.')
# 		else:
# 			temp.append('#')
# 	maze.append(temp)

ans = 0
done = set()
for i in range(n):
	for j in range(m):
		first = [i, j]
		ans = max(ans, bfs(first))
		
print(ans)

### FIXED CODE ###

'''input
3 3
.#.
#..
.#.
'''
# A coding delight
from sys import stdin, stdout
import gc
gc.disable()
input = stdin.readline
from collections import deque


def mp(arr):
	arr = map(str, arr)
	return ' '.join(arr)


def bfs(source):
	myq = deque()
	myq.append(source)
	visited = dict()
	visited[mp(source)] = True
	dist = -1
	while len(myq) > 0:
		temp = deque()
		dist += 1
		while len(myq) > 0:
			x, y  = myq.popleft()
			if x - 1 >= 0:
				if maze[x - 1][y] != '#' and mp([x - 1, y]) not in visited:
					visited[mp([x -1, y])] = True
					temp.append([x - 1, y])
			if x + 1 < n:
				if maze[x + 1][y] != '#' and mp([x + 1, y]) not in visited:
					visited[mp([x + 1, y])] = True
					temp.append([x + 1, y])
			if y - 1 >= 0:
				if maze[x][y - 1] != '#' and mp([x, y - 1]) not in visited:
					visited[mp([x, y - 1])] = True
					temp.append([x, y - 1])
			if y + 1 < m:
				if maze[x][y + 1] != '#' and mp([x, y + 1]) not in visited:
					visited[mp([x, y + 1])] = True
					temp.append([x, y + 1])
		myq = temp
	return dist		


# main starts
n, m = list(map(int, input().split()))
maze = []
for _ in range(n):
	state = list(input().strip())
	maze.append(state)

# from random import randint
# for _ in range(1000):
# maze = []
# n = randint(1, 20)
# m = randint(1, 20)
# for i in range(n):
# 	temp = []
# 	for j in range(m):
# 		k = randint(1, 2)
# 		if k == 1:
# 			temp.append('.')
# 		else:
# 			temp.append('#')
# 	maze.append(temp)

ans = 0
for i in range(n):
	for j in range(m):
		if maze[i][j] != '#':
			first = [i, j]
			ans = max(ans, bfs(first))
print(ans)
def insertionSort( nums, n, g ):
	global cnt
	for i in range( g, n ):
		v = nums[i]
		j = i - g
		while ( 0 <= j ) and ( v < nums[j] ):
			nums[ j+g ] = nums[j]
			j -= g
			cnt += 1
		nums[ j+g ] = v
		
def shellSort( nums ):
	g = []
	v = 1
	n = len( nums )
	while v <= n:
		g.append( v )
		v = 3*v+1     
	g.reverse( )
	m = len( g )
	print( m )
	print( " ".join( map( str, g ) ) )	
	for i in range( m ):
		insertionSort( nums, n, g[i] )

n = int( input( ) )
nums = [ int( input( ) ) for i in range( n ) ]
cnt = 0
shellSort( nums )
print( cnt )
for v in nums:
	print( v )

### FIXED CODE ###

import sys
 
def insertionSort( nums, n, g ):
    cnt = 0
    i = g
    while i < n:
        v = nums[i]
        j = i - g
        while 0 <= j and v < nums[j]:
            nums[ j+g ] = nums[j]
            j -= g
            cnt += 1
        nums[ j+g ] = v
        i += 1
    return cnt
         
def shellSort( nums, n ):
    g = []
    val = 1
    while val <= n:
        g.append( val )
        val = 3*val+1
     
    g.reverse( )
    m = len( g )
    print( m )
    print( " ".join( map( str, g ) ) )
    cnt = 0
    for i in range( m ):
        cnt += insertionSort( nums, n, g[i] )
    print( cnt )
     
n = int( sys.stdin.readline( ) )
nums = []
for i in range( n ):
    nums.append( int( sys.stdin.readline( ) ) )
 
shellSort( nums, n )
print( "\n".join( map( str, nums ) ) )
a, b = map(int, input().split())

if (a > 0 and a <= 9) or (b > 0 and b <=9):
	print("{}".a*b)
 else:
	print("-1")
  

### FIXED CODE ###

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

if (a > 0 and a <= 9) and (b > 0 and b <=9):
	print(a*b)
else:
	print("-1")
a = int(input())
b= int(input())
c = int(input())
d = int(input())
e = int(input())
 
 
la = [a-a//10*10,b//10*10+b,c//10*10+c,d//10*10+d,e//10*10+e].sort()
print(sum([a,b,c,d,e])+sum(la[:-1]))

### FIXED CODE ###

a = int(input())
b= int(input())
c = int(input())
d = int(input())
e = int(input())
l = [] 
for i in [a,b,c,d,e]:
    if i % 10 != 0: 
        l.append(i//10*10+10-i)
print(sum([a,b,c,d,e])+sum(sorted(l)[:-1]))
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline
n,q=map(int,input().strip().split())
d=[[] for _ in range(n)]

for _ in range(n-1):
    a,b=map(int,input().split())
    d[a-1].append(b-1)
    d[b-1].append(a-1)
l=[0]*n
for _ in range(q):
    a,b=map(int,input().split())
    l[a-1]+=b
rs=[0]*n

def rr(pa,s,dd,d):
    for c in d[s]:
        if c == pa:
            continue
        rs[c]=l[c]+dd
#        print(c,rs[c],dd)
        rr(s,c,dd+l[c],d)

s,dd=0,l[0]
rs[0] = l[0]
rr(None,s,dd,d)
for r in rs:
    print(r)


### FIXED CODE ###

import sys
sys.setrecursionlimit(300000)
input = sys.stdin.readline
n,q=map(int,input().strip().split())
d=[[] for _ in range(n)]

for _ in range(n-1):
    a,b=map(int,input().split())
    d[a-1].append(b-1)
    d[b-1].append(a-1)
l=[0]*n
for _ in range(q):
    a,b=map(int,input().split())
    l[a-1]+=b
rs=[0]*n

def rr(pa,s,dd,d):
    for c in d[s]:
        if c == pa:
            continue
        rs[c]=l[c]+dd
#        print(c,rs[c],dd)
        rr(s,c,dd+l[c],d)

s,dd=0,l[0]
rs[0] = l[0]
rr(None,s,dd,d)
for r in rs:
    print(r)
def solve(n, m, h, a, b):
    parent = {i:i for i in range(1, n+1)}
    def root(x):
        return x if parent[x] == x else root(parent[x])
    for a_j, b_j in zip(a, b):
        if root(a_j) != root(b_j):
            parent[root(b_j)] = root(a_j)
    D = {}
    for j, pj in parent.items():
        if not pj in D:
            D[pj] = []
        D[pj].append(h[j-1])
    ans = 0
    for k, v in D.items():
        v = sorted(v)
        if len(v) == 1:
            ans += 1
        elif v[-1] > v[-2]:
            ans += 1
    return ans

n, m = map(int, input().split())
h = list(map(int, input().split()))
a = [0] * m
b = [0] * m
for j in range(m):
    a[j], b[j] = map(int, input().split())
print(solve(n,m, h, a, b))

### FIXED CODE ###

def solve(n, m, h, a, b):
    for j in range(m):
        a[j] -= 1
        b[j] -= 1
    E = {i:[] for i in range(n)}
    for x, y in zip(a, b):
        E[x].append(y)
        E[y].append(x)
    ans = 0
    for i in range(n):
        ok = True
        for j in E[i]:
            if h[i] <= h[j]:
                ok = False
        ans += ok
    return ans
n, m = map(int, input().split())
h = list(map(int, input().split()))
a = [0] * m
b = [0] * m
for j in range(m):
    a[j], b[j] = map(int, input().split())
print(solve(n,m, h, a, b))
x=[int(intput()) for _ in range(5)]
k=int(input())
max=max(x)
min=min(x)
if max-min < k:
    print("Yay!")
else:
    print(":(")

### FIXED CODE ###

x=[int(input()) for _ in range(5)]
k=int(input())
max=max(x)
min=min(x)
if max-min <= k:
    print("Yay!")
else:
    print(":(")
x = input.split()
y = int(x[0])*int(x[1])
print(y)

### FIXED CODE ###

a,b = (int(x) for x in input().split())
print(a*b)
s = 'abcdefghijklmnopqrstuvwxyz'
l = [0]*26
while True:
    try:
        str=raw_input()
    except EOFError:
        break
    for i in str:
        an=ord(i.lower())-97
        if an > 25 or an < 0:
            continue
        l[an]+=1
for i in xrange(26):
    print s[i] + ' : '+ str(l[i])

### FIXED CODE ###

a='abcdefghijklmnopqrstuvwxyz'
l=[0]*26
while True:
    try:
        text=raw_input()
    except EOFError:
        break
    for i in text:
        ascNum=ord(i.lower())-97
        if ascNum < 0 or 25 < ascNum:
            continue
        l[ascNum]+=1
for i in xrange(26):
    print a[i] + ' : '+str(l[i])
import math
h,w = map(int, input().split())
print(1 if h==1 or w==1 else math.ceil(h*w/2) )

### FIXED CODE ###

a =[list(map(int, input().split())) for i in range(3)] 
n=int(input())
ans = 'No'
for i in range(n):
    d = int(input())
    for i in range(3):
        for j in range(3):
            if d == a[i][j]:
                a[i][j]=0

if a[0][0] == 0 and a[1][1] == 0 and a[2][2]==0:
    ans = 'Yes'
elif a[0][2] == 0 and a[1][1] == 0 and a[2][0]==0:
    ans = 'Yes'
else: 
    for l in a:
        if sum(l)==0:
            ans = 'Yes'
            break
    for l in zip(*a):
        if sum(l)==0:
            ans = 'Yes'
            break
        

print(ans)
import math
def solve():
    n = int(input())
    print(round(2 * math.pi * n, 2))


for _ in range(int(input())):
    solve()


### FIXED CODE ###

import math
n = int(input())
print(round(2 * math.pi * n, 2))
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,k = na()
a = na()
dp = [-1]*n
i = 1
now = 0
loop = -1
start = -1

while True:
    now = a[now]-1
    if i == k:
        print(now+1)
        exit()
    if dp[now] == -1:
        dp[now] = i
    else:
        loop = i - dp[now]
        start = now
        break
    i+=1

print(dp.index((k-start)%loop+start)+1)

### FIXED CODE ###

import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,k = na()
a = na()
dp = [-1]*n
dp[0] = 0
i = 1
now = 0
loop = -1
start = -1

while True:
    now = a[now]-1
    if i == k:
        print(now+1)
        exit()
    if dp[now] == -1:
        dp[now] = i
    else:
        loop = i - dp[now]
        start = dp[now]
        break
    i+=1

print(dp.index((k-start)%loop+start)+1)
a, b, c, k = map(int, input().split())

ans = 0
if(k <= a):
    print(k)
elif(k <= a + b):
    print(a)
else:
    ans = k - (a + b)
        print(a - ans)


### FIXED CODE ###

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

ans = 0
if(k <= a):
    print(k)
elif(k <= a + b):
    print(a)
else:
    ans = k - (a + b)
    print(a - ans)
num = input().split(" ")
num_all = int(num[0])
count = int(num[1])
cost = list(map(int, input().split()))
cost.sort()
last = 0
for i in range(count):
  last += cost[i]
print(last)

### FIXED CODE ###

word = input()
if word.islower() == True:
  print("a")
else:
  print("A")
n=int(input())
a=list(map(int,input().split()))
b=list(set(a))
if n%3!=0:
    print('No')
else:
    if b[0]^b[1]!=b[2]:
        print('No')
    elif a.count(b[0])==a.count(b[1])==a.count(b[2]):
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(set(a))
if len(b)==1 and b[0]==0:
    print('Yes')
elif len(b)==2 and min(b)==0:
    b.sort()
    if n%3==0:
        if a.count(b[0])*2==a.count(b[1]):
            print('Yes')
        else:
            print('No')
    else:
        print('No')
elif n%3!=0:
    print('No')
else:
    if len(b)!=3:
        print('No')
    elif b[0]^b[1]==b[2]:
        if a.count(b[0])==a.count(b[1])==a.count(b[2]):
            print('Yes')
        else:
            print('No')
    else:
        print('No')
s = input()
if s=="ABC":
print("ARC")
else:
  print("ABC")


### FIXED CODE ###

s = input()
if s=="ABC":
  print("ARC")
else:
  print("ABC")
N =int(input())
H = list(map(int, input().split()))
H.append(0)
#総数Nで、N番目の添字はN-1

#メモ化再帰
#今の場所からゴールまでの最小コストを出す
now = 0
memo = [-1]*N
def func(n,memo):
  if n >= N:
    return 99999999
  if n == N-1:
    memo[N-1] = 0
    return 0
  else:
    if memo[n] != -1:
      return memo[n]
    else:
      min_later = min(func(n+1,memo)+abs(H[n+1]-H[n]), func(n+2,memo)+abs(H[n+2]-H[n]))
      memo[n] = min_later
    return min_later

print(func(now,memo))

### FIXED CODE ###

N =int(input())
H = list(map(int, input().split()))
#総数Nで、N番目の添字はN-1
flog = 0

#足場iにたどり着くための最小コストをリスト化
mincost= []
for i in range(N):
  if i == 0:
    c = 0
  elif i == 1:
    c = abs(H[1]-H[0])
  else:
    c = min(abs(H[i]-H[i-1])+mincost[i-1],abs(H[i]-H[i-2])+mincost[i-2])
  mincost.append(c)

print(mincost[N-1])
a,b,c,d = map(int,input().split())
if b<c or d<a:
    print(0)
elif a<=c<d<=b:
    print(d-c)
elif a<c<b<d:
    print(b-c)
elif c<a<b<d:
    print(b-a)
elif:
    print(d-a)

### FIXED CODE ###

a,b,c,d = map(int,input().split())
if b<=c or d<=a:
    print(0)
elif a<=c<=d<=b:
    print(d-c)
elif a<=c<=b<=d:
    print(b-c)
elif c<=a<=b<=d:
    print(b-a)
elif c<=a<=d<=b:
    print(d-a)
N,A,B=map(int,input().split())
H = [int(input()) for i in range(N)]
H.sort()
from math import ceil
def KnockOut(t):
    base = B*t
    res = 0
    for i in range(j,N):
        h = H[i]
        h -= base
        if h > 0:
            res += ceil(h/(A-B))
    return res <= t
l = 1
r = ceil(sum(H)/(N*B))
while l != r-1:
    t = int((l+r)/2)
    if KnockOut(t):
        r = t
    else:
        l = t
print(r)            

### FIXED CODE ###

N,A,B=map(int,input().split())
H = [int(input()) for i in range(N)]
H.sort()
from math import ceil
def KnockOut(t):
    base = B*t
    for i in range(N):
        h = H[i]
        h -= base
        if h > 0:
            t -= ceil(h/(A-B))
            if t < 0:
                return False
    return True
l = 0
r = ceil(max(H)/B)
while l != r-1:
    t = int((l+r)/2)
    if KnockOut(t):
        r = t
    else:
        l = t
print(r)
N = int(input())
M = int(input())
if N==M:
  print("Yes")
  else:
    print("No")

### FIXED CODE ###

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

if (N==M):
  print("Yes")
else:
  print("No")
n = int(input())
arr_input = list(map(int,input().split()))

arr = sorted(arr_input)

ans = arr[n/2] - arr[n/2-1]

if ans == 0:
    print(0)
else:
    print(ans)


### FIXED CODE ###

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

arr = sorted(arr_input)
i = int(n/2)

ans = arr[i] - arr[i-1]

if ans == 0:
    print(0)
else:
    print(ans)
from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *
from heapq import *
import copy
#input()
N,M=map(int,input().split())
ABC=[list(map(int,input().split())) for i in range(M)]
data=[[] for i in range(N+1)]
for a,b,c in ABC:
    data[a].append([b,c])

stack=[[1,0,set([1]),0,{1:0}]]#p,nagasa,visited,flag
ac=[]
while stack:
    p,m,miti,flag,dic=stack.pop()
    if not flag:
        for np,value in data[p]:
            if p in miti and m+value>dic[np]:
                flag=1
                if N in miti:
                    print("inf")
                    exit()
                break
    for np,value in data[p]:
        if np==N:

            if not flag:
                ac.append(m+value)
            else:
                print("inf")
                exit()
        if not np in miti:
            tempm=m+value
            tempmiti=copy.copy(miti)
            tempmiti.add(np)
            dic=copy.copy(dic)
            dic.update({np:tempm})
            stack.append([np,tempm,tempmiti,flag,dic])
print(max(ac))


### FIXED CODE ###

from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *
from heapq import *
import copy
#input()
N,M=map(int,input().split())
ABC=[list(map(int,input().split())) for i in range(M)]

idle_max=10**18+1

dist=[idle_max for i in range(N+1)]
dist[1]=0


for loop in range(N-1):
    for a,b,c in ABC:
        c=-c
        if dist[a] != idle_max:
            dist[b]=min(dist[a] + c,dist[b])

value=dist[N]
for loop in range(N):
    for a,b,c in ABC:
        c=-c
        if dist[a] != idle_max:
            dist[b]=min(dist[a] + c,dist[b])
if value!=dist[N]:
    print("inf")
else:
    print(-value)
import sys

x = int(input())

if x >= 2000:
    print(1)
    sys.exit()

for i in range(0,int(x/100)):
    if 100*i <= x <= 105*i:
        break

for a in range (0,i):
    for b in range (0,i):
        for c in range (0,i):
            for d in range (0,i):
                for e in range (0,i):
                    for f in range (0,i):
                        total = 100*a + 101*b + 102*c + 103*d + 104*e + 105*f
                        if total == x:
                            print(1)
                            sys.exit()

print(0)

### FIXED CODE ###

x = int(input())

# 商品の合計がi個の場合の可能なxの範囲
# i=1   100-105
# i=2   200-210
# i=3   300-315
# i=4   400-420
# i=5   500-525
# i=6   600-630
# i=7   700-735
# i=8   800-840
# i=9   900-945
# ...
# i=19 1900-1995
# i=20以降は常に1

i = x // 100

if 100*i <= x <= 105*i:
  print(1)
else:
  print(0)
i=1
while True:
   print("Case"+" "+str(i)+":"+" "+input())
   i+=1
   if int(input())==0:
       break


### FIXED CODE ###

i=1
while True:
    x=int(input())
    if x==0:
        break
    print("Case {}: {}".format(i,x))
    i+=1
s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])

if a == b && b != c:
  print("Yes")
  exit()
if a == c && b != c:
  print("Yes")
  exit()
if c == b && a != c:
  print("Yes")
  exit()

print("No")

### FIXED CODE ###

s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])

if a == b and b != c:
  print("Yes")
  exit()
if a == c and b != c:
  print("Yes")
  exit()
if c == b and a != c:
  print("Yes")
  exit()

print("No")
s = int(input().replace(' ','')
print("Yes" if int(s**0.5)**2==s) else "No")

### FIXED CODE ###

s = int(input().replace(' ',''))
print("Yes" if int(s**0.5)**2==s else "No")
n = int(input())
    nStr = str(n)
    print(nStr[len(nStr)-1])
    if nStr[len(nStr)-1] == '3':
        print('bon')
    elif nStr[len(nStr)-1]  == {'0','1','6','8'}:
        print('pon')
    else:
        print('hon')

### FIXED CODE ###

n = int(input()) % 10
if n == 3:
  print("bon")
elif n in(0,1,6,8):
  print("pon")
else:
  print("hon")
A, B = map(int, input().split())
if (A -B) % 2  == 0):
    K = (A+B) / 2
    if (A - K)!2 == (B - K)!2:
        print(K)
    else:
        print("IMPOSSIBLE")
else:
    print("IMPOSSIBLE")



### FIXED CODE ###

A, B = map(int, input().split())
K =  (A + B) // 2
if ((A + B)%2 == 0) & ((A-K)**2==(B-K)**2):
    print(K)
else:
    print("IMPOSSIBLE")