Harryxun/stf_run huggingface dataset:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()

rt = [[] for i in range(n)]
srb = [None] * n
dk = [10**10]*n


for i in range(m):
    a,b = mi()
    rt[a-1].append(b-1)
    rt[b-1].append(a-1)

from collections import deque
l = deque()

srb[0] = 0
for i in rt[0]:
    l.append(i)
    srb[i] = 1

while len(l) != 0:
    print(l)
    c = l.popleft()
    for i in rt[c]:
        if srb[i] == None:
            l.append(i)
            srb[i] = c+1

print('Yes')
for i in range(1,n):
    print(srb[i])




### FIXED CODE ###

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()

rt = [[] for i in range(n)]
srb = [None] * n
dk = [10**10]*n


for i in range(m):
    a,b = mi()
    rt[a-1].append(b-1)
    rt[b-1].append(a-1)

from collections import deque
l = deque()

srb[0] = 0
for i in rt[0]:
    l.append(i)
    srb[i] = 1

while len(l) != 0:
    c = l.popleft()
    for i in rt[c]:
        if srb[i] == None:
            l.append(i)
            srb[i] = c+1

print('Yes')
for i in range(1,n):
    print(srb[i])
a=input()
b=input()

print("{} {}".format(a*b,a**2+b**2))


### FIXED CODE ###

a,b=[int(x) for x in input().split()]
print(a*b,2*a+2*b)
a,b,c=int(input().splot())
if a == b:
    if a != c:
        print('yes')
    else:
        print("no")
elif a == c:
    if (a != b:
        print('yes')
    else:
        print("no")
else:
    print("no")


### FIXED CODE ###

a,b,c=input().split()
if a == b:
    if a != c:
        print('Yes')
    else:
        print("No")
elif a == c:
    if a != b:
        print('Yes')
    else:
        print("No")
elif b == c:
    if b != a:
        print('Yes')
    else:
        print("No")
else:
    print("No")
N = int(input())

A = list(map(int,input().split()))

for i in range(N):
    print(A.index(i)+1,end=" ")

### FIXED CODE ###

N = int(input())

A = list(map(int,input().split()))

B = [0]*N

for i in range(N):
    B[A[i]-1] = i+1

print(*B)
s = int(input())
 
ans=0
 
def f(n):
  if (n % 2 == 0):
    return n / 2
  else:
    return 3*n + 1
  
while (True):
  a_n = [s]
  for i in len(a_n):
    if (a_n.count(4) != 2):
      a_i = f(a_n.pop(-1))
      a_n.append(a_i)
    else:
      index = a_n.index(4)
      ans = a_n[index+3]
      break
    
print(ans)

### FIXED CODE ###

s = int(input())
 
ans = 0
 
if (s == 1 or s == 2 or s == 4):
  print(4)
else:
  while (s != 4):
    if (s % 2 == 0):
      s  =  int(s/2)
    else:
      s = 3*s + 1
    ans += 1
  
 
  print(ans+4)
ax, at = map(int, input().split(' '))
bx, bt = map(int, input().split(' '))
t = int(input())
 
a_l = ax + at*t
b_l = bx + bt*t
 
if a_l < b_l and at == bt:
	print("NO")
else:
	print("YES")

### FIXED CODE ###

name = input()
print(name[0:3])
print([x[0].upper() for x in input().split()].join())

### FIXED CODE ###

print(''.join([x[0].upper() for x in input().split()]))
4
5 7

### FIXED CODE ###

K = int(input())
A,B = map(int,input().split())

flag = False
for i in range(A,B+1):
    if i % K == 0:
        flag = True
        break

if flag:
    print('OK')
else:
    print('NG')
import math

K = int(input())
sum = 0

for i in (1, K + 1):
  for j in range(1, K + 1):
    for k in range(1, K + 1):
      sum += math.gcd(i, j, k)
      
print(sum)

### FIXED CODE ###

import math
K = int(input())
rst = 0
for i in range(1, K + 1):
    for j in range(1, K + 1):
        tmp = math.gcd(i, j)
        for k in range(1, K + 1):
            rst += math.gcd(tmp, k)
print(rst)
a,b = map(int, input().split())

if a >= 13:
  print(b)
elif: a =< 5:
    print(0)
else:
  print(int(b/2))
  

### FIXED CODE ###

a, b = map(int, input().split())
 
if a >= 13:
  print(b)
elif a <= 5:
    print(0)
else:
  print(int(b/2))
n = int( raw_input() )
A = map( int , raw_input().split() )
q = int( raw_input() )
m = map( int , raw_input().split() )

for i in range( len(A) + 1 ):
  def solve(i, m)
    if m == 0 or solve( i+1 , m ) or solve( i+1 , m-A[i] ):
      print 'yes'
    if i >= n or m < 0:
      print 'no'


   

### FIXED CODE ###

n = input()
A = map( int , raw_input().split() )
q = input()
mi = map( int , raw_input().split() )

def solve(i, m):
  if m == 0:
    return True
  elif i >= n or m > sum(A):
    return False

  res = solve( i+1 , m ) or solve( i+1 , m-A[i] )
  return res

for m in mi:
  if solve( 0 , m ): print "yes"
  else: print "no"
while True:
    line = input()
    if not line:
        break
    a, b = map(int, line.split())
    print(a + b)

### FIXED CODE ###

while True:
    try:
        line = input()
    except EOFError:
        break
    s = sum(map(int, line.split()))
    num = 0
    for c in str(s):
        if c.isdigit():
            num += 1
    print(num)
N=int(input())
mod_lar = 10**9+7

def fact_mod(n):
    if n==1:
        return 1
    ans = int((n%mod_lar)*(fact_mod(n-1)%mod_lar))
    return ans

print(fact_mod(N))

### FIXED CODE ###

N=int(input())
mod_lar = 10**9+7
ans =1

for i in range(1,N+1):
    ans = (i%mod_lar)*(ans%mod_lar)%mod_lar
    

print(ans)
A = [int(i) for i in raw_input().split()]
N = len(A)
A0 = [A[i] for i in xrange(0, N, 2)]
A1 = [A[i] for i in xrange(1, N, 2)]

Count = 0
S0 = set(A0)
S1 = set(A1)
N0 = []
N1 = []

if len(S0) == 1:
    N0[0] = append((S0[0], len(A0)))
else:
    for s in S0:
        N0.append((s, sum(map(lambda x: x==s, A0))))


if len(S1) == 1:
    N1.append = (S1[0], len(A1))
else:
    for s in S1:
        N1.append((s, sum(map(lambda x: x==s, A1))))

N0.sort(key=lambda x: x[1], reverse=True)
N1.sort(key=lambda x: x[1], reverse=True)

if N0[0][0] == N1[0][0]:
    if N0[0][0] > N1[0][0]:
        if len(N1) == 1:
            print N - N0[0][1]
        else:
            print N - N0[0][1] - N1[1][1]
    else:
        if len(N0) == 0:
            print N - N1[0][1]
        else:
            print N - N0[1][1] - N1[0][1]
else:
    print N - N0[0][1] - N1[0][1]


### FIXED CODE ###


from collections import Counter

n    = int(raw_input())
nums = list(map(int, raw_input().split()))

nums_odd  =   nums[0:n:2]
nums_even =   nums[1:n:2]

N_odd     =   sorted(Counter(nums_odd ).items(), key=lambda x: x[1], reverse=True) + [(-1,0)]
N_even    =   sorted(Counter(nums_even).items(), key=lambda x: x[1], reverse=True) + [(-1,0)]

if N_odd[0][0] == N_even[0][0]:
    if N_odd[0][1] + N_even[1][1] > N_odd[1][1] + N_even[0][1]:
        print n - N_odd[0][1] - N_even[1][1]
    else:
        print n - N_odd[1][1] - N_even[0][1]
else:
    print n - N_odd[0][1] - N_even[0][1]
n=int(input())  #数値入力 「N」だけの入力のとき

S = []
for _ in range(n):
    S.append(set(input()).sort())
print(n-len(set(S))+1)

### FIXED CODE ###

import collections
N=int(input())
S=[''.join(sorted(input())) for _ in range(N)]
C=collections.Counter(S)
ans=0
for si in set(S):
  n=C[si]
  ans+=n*(n-1)//2
print(ans)
n=int(input())
s=list(input())
a=[]
kind=0
l=[]
for i in s:
  l.append(i)
  for j in l:
    if j in s:
      kind+=1
  a.append(kind)
print(max(kind))

### FIXED CODE ###

n=int(input());s=input();print(max(len(set(s[:i])&set(s[i:]))for i in range(n)))
#copy code
s = input()
dic = {SUN : 7,
       MON :6,
       TUE:5,
       WED:4,
       THU:3,
       FRI:2,
       SAT:1}

print(dic[s])

### FIXED CODE ###

s = input()
dic = {'SUN':7,
       'MON':6,
       'TUE':5,
       'WED':4,
       'THU':3,
       'FRI':2,
       'SAT':1}

print(dic[s])
import math

def eratosthenes():
    cnt = dict()
    lim = int(math.sqrt(max(set_a)))
    for i in range(2, lim+1):
        for res in range(i, max(set_a)+1, i):
            if res in set_a:
                cnt[res] = cnt.get(res, 0) + 1
    return cnt


n = int(input())
a = [int(x) for x in input().split()]
set_a = set(a)

ans = eratosthenes()

if max(ans.values()) == 1 and len(set_a) == n:
    print('pairwise coprime')
else:
    res = a[0]
    for i in range(n):
        res = math.gcd(res, a[i])
    if res == 1:
        print('setwise coprime')
    else:
        print('not coprime')

### FIXED CODE ###

import math

def eratosthenes():
    erat = [0 for _ in range(max_a+1)]
    #lim = int(math.sqrt(max_a))
    pair = True
    #for i in range(2, lim+1):
    for i in range(2, max_a+1):
        cnt = 0
        if not erat[i]:
            for res in range(i, max_a+1, i):
                if res in set_a:
                    cnt += 1
                erat[res] = i
                if cnt > 1:
                    pair = False
                    break
        if not pair:
            break
    return pair


n = int(input())
a = [int(x) for x in input().split()]
max_a = max(a)
set_a = set(a)

if eratosthenes() and len(set_a) == n - max(0, a.count(1)-1):
    print('pairwise coprime')
else:
    res = a[0]
    for i in range(n):
        res = math.gcd(res, a[i])
    if res == 1:
        print('setwise coprime')
    else:
        print('not coprime')
n = int(input())

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

sigma = sum(a)
count = 0
for i in range(len(a)-1):
  start = a[i]
  sigma = sigma-a[i]
  count = count + start * 
  if count >= 10**9+7:
    count = count % (10**9+7)

print(count)

### FIXED CODE ###

n = int(input())

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

sigma = 0
after = sum(a[0:])
for i in range(len(a)-1):
  start = a[i]
  after = after - a[i]
  sigma = sigma + start * after
  if sigma >= (10**9 + 7):
    sigma = sigma % (10**9+7)

print(sigma)
N = int(input())
H = list(map(int, input().split()))

dp = [0] * N
dp[1] = abs(H[1]-H[0])

def func(i):
    if i >= N:
        return 0
    else:
        dp[i] = min((dp[i-1]+abs(H[i-1]-H[i]), dp[i-2]+abs(H[i-2]-H[i])))
        func(i+1)

func(2)
print(dp[N-1])

### FIXED CODE ###

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

dp = [0] * N
dp[1] = abs(H[1]-H[0])
for i in range(2, N):
    dp[i] = min((dp[i-1]+abs(H[i-1]-H[i]), dp[i-2]+abs(H[i-2]-H[i])))

print(dp[N-1])
import fractions
def lcm(a,b):
    return a*b//fractions.gcd(a,b)

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

P=[c,d,lcm(c,d)]
A=[]
for p in P:
    if a%p==0:
        left=a//p
    else:
        left=a//p+1
    right=b//p
    if left<=right:
        A.append(right-left+1)
print(b-a+1-A[0]-A[1]+A[2])

### FIXED CODE ###

import fractions
def lcm(a,b):
    return a*b//fractions.gcd(a,b)

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

P=[c,d,lcm(c,d)]
A=[]
for p in P:
    if a%p==0:
        left=a//p
    else:
        left=a//p+1
    right=b//p
    if left<=right:
        A.append(right-left+1)
    else:
        A.append(0)
print(b-a+1-A[0]-A[1]+A[2])
a = int(input())
  if 1<=a<=10: 
    b = a + a**2 + a**3
    print(b)
  
  

### FIXED CODE ###

a = int(input())
print(a+a**2+a**3)
A =[] 
while True:
    try:
        A.append(sorted(list(map(int,input().split())),reverse=True))

    except:
        break
        #または、quit(),os.exit()をして止める。


def triangle_types(X):
    print(X)
    num_of_acute = 0
    num_of_right = 0
    num_of_obtuse = 0
    num_of_normal = 0
    for i in range(len(X)):
        a,b,c = [j for j in X[i]]
        ans = b**2 + c**2 - a**2
        print("a:{},b+c:{}".format(a,b+c))
        if (a < b + c and b < a + c and c < a + b):
            num_of_normal+=1
            if (ans > 0):
                num_of_acute+=1
            elif (ans == 0):
                num_of_right+=1
            elif (ans < 0):
                num_of_obtuse+=1
            else:
                print("{} {} {} {}".format(num_of_normal,num_of_right,num_of_acute,num_of_obtuse))
                return
        else:
            print("{} {} {} {}".format(num_of_normal,num_of_right,num_of_acute,num_of_obtuse))
            return
    print("{} {} {} {}".format(num_of_normal,num_of_right,num_of_acute,num_of_obtuse))
    return

if __name__ == '__main__':
    triangle_types(A)



### FIXED CODE ###

A=[]
while True:
    try:
        A.append(sorted(list(map(int,input().split())),reverse=True))

    except:
        break

def triangle_types(X):
    num_of_normal = 0
    num_of_right = 0
    num_of_acute = 0
    num_of_obtuse = 0

    for i in range(len(X)):
        a,b,c = [X[i][j] for j in range(3)]
        if (a < b + c and b < a + c and c < a + b):
            num_of_normal +=1
            if (a**2 == b**2 + c**2):
                num_of_right += 1
            elif (a**2 < b**2 + c**2):
                num_of_acute +=1
            elif (a**2 > b**2 + c**2):
                num_of_obtuse += 1
        else:
            print("{} {} {} {}".format(num_of_normal,num_of_right,num_of_acute,num_of_obtuse))
            return


if __name__ == '__main__':
    triangle_types(A)
n = input()
s = list(input())
a = {}
for i in range(1,int(n)+1):
    a[i] = int(s[2*i-2])

result = 0
for i in range(1,int(n)+1):
    if a[a[i]] == i:
        result = result+1
result = int(result/2)
print(result)

### FIXED CODE ###

n = input()
a = input()
a = a.split(sep=' ')

result = 0
for i in range(1,int(n)+1):
    if int(a[int(a[i-1])-1]) == i:
        result = result+1
result = int(result/2)
print(result)
def gcd(x,y):
    if x>=y:
        if x%y==0:
            return y
        else:
            return gcd(y,x%y)
    else:
        if y%x==0:
            return x
        else:
            return gcd(x,y%x)
def gcd2(x4):
    if len(x4)>2:
        return gcd2([gcd(x4[0],x4[1]),]+x4[2:])
    elif len(x4) ==2:
        return gcd(x4[0],x4[1])
    else:
        return x4[0]
N, X = map(int,input().split())
x=[int(i) for i in input().split()]
x.append(X)
x3=[]
for i in range(len(x)-1):
    x3.append(abs(x[i+1]-x[i]))
print(gcd2(x3))


### FIXED CODE ###

def gcd3(x,y):
    if x>=y:
        if x%y==0:
            return y
        else:
            return gcd3(y,x%y)
    else:
        if y%x==0:
            return x
        else:
            return gcd3(x,y%x)
def gcd2(x4):
    if len(x4)>2:
        return gcd3(gcd2(x4[:len(x4)//2]),gcd2(x4[len(x4)//2:]))
    elif len(x4) ==2:
        return gcd3(x4[0],x4[1])
    else:
        return x4[0]
N, X = map(int,input().split())
x=[int(i) for i in input().split()]
x.append(X)
x3=[]
for i in range(len(x)-1):
    x3.append(abs(x[i+1]-x[i]))
print(gcd2(x3))
X = int(input())
if X >= 500:
  q = X // 500 
  mod = X % 500 
  f = mod // 5
  print(q*1000+f*5)
else:
  f = X // 5
  print(f*5

### FIXED CODE ###

X = int(input())
if X >= 500:
  q = X // 500 
  mod = X % 500 
  f = mod // 5
  print(q*1000+f*5)
else:
  f = X // 5
  print(f*5)
from collections import Counter

n,m = map(lambda x: int(x), input().split())
x = [0 for i in range(10005)]
tot=0
ac=0
for i in range(m):
	p, s = input().split()
	p=int(p)
	if x[p] == -1:
		continue
	if s == 'AC':
		ac +=1
		tot+=x[p]
		x[p]=-1
	elif s == 'WA':
		x[p] += 1
print(ac, tot)

### FIXED CODE ###

from collections import Counter

n,m = map(lambda x: int(x), input().split())
x = [0 for i in range(100005)]
tot=0
ac=0
for i in range(m):
	p, s = input().split()
	p=int(p)
	if x[p] == -1:
		continue
	if s == 'AC':
		ac +=1
		tot+=x[p]
		x[p]=-1
	elif s == 'WA':
		x[p] += 1
print(ac, tot)
data = lists(map(int, input().split()))
print (max(data) - min(data))

### FIXED CODE ###

data = list(map(int, input().split()))
print (max(data) - min(data))
n,x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list = sorted(x_list)
a = []
for i in range(n):
    b = x_list[i+1]-x_list[i]
    a.append(b)
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
ans = gcd(*a)
print(int(ans))

### FIXED CODE ###

n,x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list = sorted(x_list)
a = []
for i in range(n):
    b = x_list[i+1]-x_list[i]
    a.append(b)
import math
from functools import reduce
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
ans = reduce(gcd, a)
print(int(ans))
import math
A,B,N = map(int,input().split())
maxi = -100000
Npower = 0
diff = 0
while N > 1:
    N /=10
    Npower += 1
if Npower >= 6:
  diff = N-1000
for i in range(diff,N+1):
    maxi = max(math.floor(A*i/B)-A*math.floor(i/B),maxi,0)
print(maxi)


### FIXED CODE ###

import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))
N = int(input())

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

m = {}

def sort_str(s):
    return "".join(sorted(list(s)))

for i in range(N):
    s = str(input())
    ss = sort_str(s)

    if ss in m:
        m[ss] += 1
    else:
        m[ss] = 1


count = 0

for c in m.values():
  	if c > 1:
    	count += cmb(c, 2)

print(count)

### FIXED CODE ###

N = int(input())

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

m = {}

def sort_str(s):
    return "".join(sorted(list(s)))

for i in range(N):
    s = str(input())
    ss = sort_str(s)

    if ss in m:
        m[ss] += 1
    else:
        m[ss] = 1


count = 0

for c in m.values():
    if c > 1:
        count += cmb(c, 2)

print(count)
N,b,r = map(int, input().split())
 
num = int(N / (b+r))
rest = N - num * (b + r)

if rest >= b:
	print(num * b + b)
else:
	print(num * b + rest)

### FIXED CODE ###

S = input()

if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")
import math
A, B = list(map(decimal, input().split()))
print(math.floor(A*B))

### FIXED CODE ###

import math
from decimal import *
A, B = list(map(Decimal, input().split()))
print(math.floor(A*B))
S = input()


temp1 = S[1]
temp2 = S[2]
temp3 = S[3]
temp4 = S[4]


if temp1 == temp2 and temp3 == temp4 and len(set(S))==2:
    print("Yes")
elif temp1 == temp3 and temp2 == temp4 and len(set(S))==2:
    print("Yes")
elif temp1 == temp4 and temp2 == temp3 and len(set(S))==2:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

S = input()


S = list(set(S))

if len(S) == 2:
    print("Yes")
else:
    print("No")
import math
N,K=map(int,input().split())

def combinations_count(n,r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))

if K==0:
    print(0)
else:
    for i in range(1,K+1):
        print((combinations_count(N-K+1,i)*combinations_count(K-1,i-1))%(10**9+7))


### FIXED CODE ###

import math
N,K=map(int,input().split())

def combinations_count(n,r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))

for i in range(1,K+1):
    if N-K+1>=i:
        print((combinations_count(N-K+1,i)*combinations_count(K-1,i-1))%(10**9+7))
    else:
        print(0)
import math
a,b = map(int,input().split())
print(math.ceil((a+b)/2)))

### FIXED CODE ###

import math
a,b = map(int,input().split())
print(math.ceil((a+b)/2))
from sys import stdin

N, *A = map(int, stdin.read().split())

A_min = min(A)

k = 1
for i in range(int(A_min**0.5))[::-1]:
    if A_min % (i+1) != 0:
        continue
    k1, k2 = i+1, A_min//(i+1)
    if all(a % k2 == 0 for a in A):
        k = max(k, k2)
    elif all(a % k1 == 0 for a in A):
        k = max(k, k1)

print(k)

# D

from sys import stdin

N, M, *A = map(int, stdin.read().split())
req = {1: 2,
       2: 5,
       3: 5,
       4: 4,
       5: 5,
       6: 6,
       7: 3,
       8: 7,
       9: 6}

num = sorted([(a, req[a]) for a in A], key=lambda x: x[1])
k_min, n_min = num[0]
gt = sorted([(k, n-n_min) for k, n in num[1:] if k > k_min],
            key=lambda x: x[0], reverse=True)
lt = sorted([(k, n-n_min) for k, n in num[1:] if k < k_min],
            key=lambda x: x[0])
order = N // n_min
sum_rem = N - n_min*order

lst = []
for k, n in gt:
    m = sum_rem // n
    lst.extend([k]*m)
    sum_rem -= n*m
for k, n in lt:
    m = sum_rem // n
    lst.extend([k]*m)
    sum_rem -= n*m
lst.extend([k_min]*(order-len(lst)))


print(''.join(map(str, sorted(lst, reverse=True))))

### FIXED CODE ###

from sys import stdin

N, M, *A = map(int, stdin.read().split())
req = {1: 2,
       2: 5,
       3: 5,
       4: 4,
       5: 5,
       6: 6,
       7: 3,
       8: 7,
       9: 6}

B = sorted([(a, req[a]) for a in A], key=lambda x: x[0], reverse=True)
a_min, n_min = min(B, key=lambda x: x[1])
g = [(a, n-n_min) for a, n in B if a > a_min and n > n_min]
l = [(a, n-n_min) for a, n in B if a < a_min and n > n_min]
l.sort(key=lambda x: x[1], reverse=True)
C = g + l

def dp(rem, C):
    ret = None
    if rem == 0:
        ret = []
    elif rem > 0:
        for i in range(len(C)):
            a, m = C[i]
            nxt = dp(rem-m, C[i:])
            if nxt is not None:
                ret = [a] + nxt
                break
    return ret


i = 0
while True:
    quo = N // n_min - i
    rem = N % n_min + i * n_min
    lst = dp(rem, C)
    if lst is not None:
        lst = sorted(lst + [a_min] * (quo-len(lst)), reverse=True)
        print(''.join(map(str, lst)))
        break
    i += 1
a, b, c = [int(x) for x in raw_input().split(" ")]
list =[a,b,c]
list_2 = []

for x in range(len(list)):
    mini = min(list)
    list_2.append(mini)
    list.remove(mini)

for x in range(0, len(list_2)):
    a = list_2[x]

    if x == 0:
        req = str(a) + " "
    else:
        req += str(a) + " "

q = req.rstrip()
print(req)

### FIXED CODE ###

a, b, c = [int(x) for x in raw_input().split(" ")]
list =[a,b,c]
list_2 = []

for x in range(len(list)):
    mini = min(list)
    list_2.append(mini)
    list.remove(mini)

for x in range(0, len(list_2)):
    a = list_2[x]

    if x == 0:
        req = str(a) + " "
    else:
        req += str(a) + " "

q = req.rstrip()
print(q)
import sys
input = sys.stdin.readline


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*N
        for i, a in enumerate(A):
            bottom = max(0, i-a)
            top = min(N, i+a+1)

            # B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
            B[bottom] += 1
            B[top] -= 1
        for j in range(1, N):
            B[j] += B[j-1]

        if A == B:
            A = B[:]
            break
        A = B[:]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()
N = int(input())
p = list(map(int, input().split()))
err = 0
for i in range(N):
  if p[i]!=i:
    err+=0
if err == 0:
  print("YES")
elif err == 2:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a, b = map(int, input().split())
if (a+b)%2 == 1:
  print("IMPOSSIBLE")
else:
  print((a+b)//2)