Harryxun/stf_run huggingface dataset:
n,q = map(int, raw_input().split())
que = [map(str, raw_input().split()) for i in range(n)]
for i in range(n):que[i][1] = int(que[i][1])
mxt = sum([y for x,y in que])
t = 0
i = 0
while t < mxt:
	i %= n
	c = que[i][1]
	if c <= q:
		t += c
		que.pop(i)
		n -= 1
		print a[0],t				
	else:
		t += q
		que[i][1] = c - q
		i += 1

### FIXED CODE ###

n,q = map(int, raw_input().split())
que = [map(str, raw_input().split()) for i in range(n)]
for i in range(n):que[i][1] = int(que[i][1])
mxt = sum([y for x,y in que])
t = 0
i = 0
while t < mxt:
    if i >= n: i %= n
    if que[i][1] <= q:
        t += que[i][1]
        print que[i][0],t
        que.pop(i)
        n -= 1
    else:
        t += q
        que[i][1] -= q
        i += 1
While True:                                                                                      
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    countl = 0
 
    while True:
        if W == 0:
            break
        if countl == H:
            break
        elif countl % 2 == 0:
            countll = 0
            while True:
                if countll % 2 == 0:
                    print('#', end='')
                    countll += 1
                else:
                    print('.', end='')
                    countll += 1
                if countll == W:
                    print()
                    break
        elif countl % 2 == 1:
            countll = 0
            while True:
                if countll % 2 == 0:
                    print('.', end='')
                    countll += 1
                else:
                    print('#', end='')
                    countll += 1
                if countll == W:
                    print()
                    break
        countl += 1
    print()

### FIXED CODE ###

while True:                                                                                      
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    countl = 0
 
    while True:
        if W == 0:
            break
        if countl == H:
            break
        elif countl % 2 == 0:
            countll = 0
            while True:
                if countll % 2 == 0:
                    print('#', end='')
                    countll += 1
                else:
                    print('.', end='')
                    countll += 1
                if countll == W:
                    print()
                    break
        elif countl % 2 == 1:
            countll = 0
            while True:
                if countll % 2 == 0:
                    print('.', end='')
                    countll += 1
                else:
                    print('#', end='')
                    countll += 1
                if countll == W:
                    print()
                    break
        countl += 1
    print()
n, k = map(int, input().split())
a = list(map(int, input().split()))

k = k % mod
mod = 10 ** 9 + 7
# 配列内で自身より小さい数の個数　前後別に求める
b = [[0, 0] for _ in range(n)]
for i in range(n):
    for j in range(n):
        if a[i] > a[j]:
            if i > j:
                b[i][0] += 1
            else:
                b[i][1] += 1
ans = 0
sigmakp = int(((k * (k+1)) % mod) / 2) % mod
sigmakn = int(((k * (k-1)) % mod) / 2) % mod
for i in range(n):
    mae = (sigmakp * b[i][1]) % mod
    ushiro = (sigmakn * b[i][0]) % mod
    ans = ((mae + ushiro) % mod + ans) % mod 
print(ans)

### FIXED CODE ###

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

mod = 10 ** 9 + 7
k = k % mod
# 配列内で自身より小さい数の個数　前後別に求める
b = [[0, 0] for _ in range(n)]
for i in range(n):
    for j in range(n):
        if a[i] > a[j]:
            if i > j:
                b[i][0] += 1
            elif i < j:
                b[i][1] += 1
    b[i][0] = b[i][0] % mod
    b[i][1] = b[i][1] % mod
ans = 0

if k%2 == 0:
    sigmakp = (int(k/2) * (k+1)) % mod
    sigmakn = (int(k/2) * (k-1)) % mod
else:
    sigmakp = (int((k+1)/2) * k) % mod
    sigmakn = (int((k-1)/2) * k) % mod

for i in range(n):
    mae = (sigmakp * b[i][1]) % mod
    ushiro = (sigmakn * b[i][0]) % mod
    ans = ((mae + ushiro) % mod + ans) % mod 
print(ans)
N = int(input())
a = [input() for i in range(N)]
P=round(sum(A)/N)
B=0
for i in range(N):
	B=B+(A[i]-P)**2
print(B)

### FIXED CODE ###

N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))
print(max(1,[int(i)for i in input()[:int(input())]if i!="1"][0]))

### FIXED CODE ###

s=input()
k=int(input())
for i in range(k):
    if s[i] !="1":
        print(s[i])
        exit()
print("1")
a,b=input().split()
a0=a//(10**9)
a1=a-a0*10**9
b*=100
print((a0*b*10**9+a1*b)//100)

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=list(b)
b=[int(b[0]),int(b[2]),int(b[3])]
c=(a*b[0]*100+a*b[1]*10+a*b[2])//100
print(c)
import math
 
H, W = list(map(int, input().split()))
board = []
L = [[0 for i in range(W)] for i in range(H)]
R = [[0 for i in range(W)] for i in range(H)]
U = [[0 for i in range(W)] for i in range(H)]
D = [[0 for i in range(W)] for i in range(H)]

# H, W = 4, 6
# board = [['#', '.', '.', '#', '.', '.'], ['.', '.', '.', '.', '.', '#'], ['.', '.', '.', '.', '#', '.'], ['#', '.', '#', '.', '.', '.']]

# insert elements to the board
for i in range(H):
	a = list(input())
	board.append(a)


# high_score is output values
high_score = 0
	
# round robin
for h in range(H):
	for w in range(W):
		# print(h, w)
		# board put light is envolved
		score = 1
		# if not obstacle in board[h][w]
		if board[h][w] != "#":
			# DOWN
			for i in range(1, H):
				if h - i == -1:
					break
				elif board[h - i][w] == "#":
					break
			score += i - 1
			D[h][w] = i - 1
			
			# UP
			if h == 0 or board[h - 1][w] == "#":
				U[h][w] = 0
			else:
				U[h][w] = U[h - 1][w] + 1
			score += U[h][w]
			
			# RIGHT
			for i in range(1, W):
				if w + i == W:
					break
				elif board[h][w + i] == "#":
					break
			score += i - 1
			R[h][w] = i - 1
			
			# LEFT
			if w == 0 or board[h][w - 1] == "#":
				L[h][w] = 0
			else:
				L[h][w] = L[h][w - 1] + 1
			score += L[h][w]
			
			# print(score)
			if score > high_score:
				high_score = score
				
print(high_score)

### FIXED CODE ###

A = list(map(int, input().split()))
A = sorted(A)
print(sum(A[:2]))
n = int(input())
A = list(map(int, input().split()))
count = 0
for i in range(1, n-1):
  pA = sorted(A[i-1:i+2])  
  print(pb)
  if pA[1] == A[i]:
    count += 1
print(count)    

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
count = 0
for i in range(1, n-1):
  pA = sorted(A[i-1:i+2])  
  if pA[1] == A[i]:
    count += 1
print(count)
K = int(input())

gcd = lambda a,b : a if b == 0 else gcd(b, a % b)
gcd3 = lambda a,b,c = gcd(c, gcd(a,b))

print(sum(list(map(lambda: x,y,z: gcd3(x,y,z), list(range(1,K+1))))))

### FIXED CODE ###

from math import gcd
K = int(input())
r = range(1,K+1)
print(sum(gcd(gcd(a,b),c)for a in r for b in r for c in r))
import itertools as it
dic={}
bing=[[1 for i in range(3)] for j in range(3)]
for i in range(3):
    f=list(map(int,input().split()))
    for each in f:
        dic.update({each:(i,f.index(each))})
n=int(input())
for i in range(n):
    m=int(input())
    if m in dic.keys():
      place=dic[m]
      bing[place[0]][place[1]]=0
flag=False
code="000102101112202122"
code=code+code[::-1]
code=code+"001122021120"

for i in range(8):
    code_sep=code[6*i:6*i+6]
    p=0
    for j in range(3):
        cords=code_sep[2*j:2*j+2]
        p+=bing[int(cords[0])][int(cords[1])]
    if p==0:
        flag=True
        break
    
print("yes")if flag else print("No")

### FIXED CODE ###

print( int( (int(input()) + 1 )/2 ) )
x=int(input())

a=int(100)
for i in range (3800)  :
    a=int(a*1.01)
    #a=round(a) roundは四捨五入、intは切り捨て
    if a < x:
        continue
    else:
        break

print(i+1)　
#range関数によるリストは1番目が0

### FIXED CODE ###

x=int(input())

a=int(100)
for i in range (3800)  :
    a=int(a*1.01)
    #a=round(a) roundは四捨五入、intは切り捨て
    if a < x:
        continue
    else:
        break

print(i+1)
#range関数によるリストは1番目が0
n = int(input())
s=[''.join(int(input())) for i in range(n)]
s_sort=sorted(s,reverse=True)
for i in range(n):
    if s[i] == s_sort[0]:
        print(s_sort[1])
    else:
        print(s_sort[0])


### FIXED CODE ###

n = int(input())
s=[int(input()) for i in range(n)]
s_sort=sorted(s,reverse=True)
for i in range(n):
    if s[i] == s_sort[0]:
        print(s_sort[1])
    else:
        print(s_sort[0])
import math
N = int(input())
ans = math.inf
for i in range(1, 1+math.floor(math.sqrt(N))):
    if N % i == 0:
        ans = min(ans, len(str(N//i)))
print(ans)


### FIXED CODE ###

import math
N = int(input())
ans = N
for i in range(1, 1+math.floor(math.sqrt(N))):
    if N % i == 0:
        ans = min(ans, len(str(N//i)))
print(ans)
import sys
input = sys.stdin.readline

S = input()
Q = int(input())
A = [[input().split()] for _ in range(Q)]

for i in range(Q):
  if A[i] == ["1"]:
    S = ''.join(list(reversed(S)))
  else:
    if A[i][1] == "1":
      S = S + A[i][2]
    else:
      S = A[i][2] + S
      
print(S)
    


### FIXED CODE ###

s = input()
q = int(input())
par = 0
pre = ""
pos = ""

for i in range(q):
  t = input().split()
  if t[0] == "1":
    par += 1
  elif (par + int(t[1]))%2 == 1:
    pre = t[2] + pre
  else:
    pos = pos + t[2]
    
ans = pre + s + pos

if par%2 == 0:
  print(ans)
else:
  print(ans[::-1])
n = int(input())
a = list(map(int,input().split()))

cnt = 0

for i in range(n):
    while(True):
        if a[i] % 2 != 0:
            break
        else:
            a[i] = int(a[i] / 2)
            cnt += 1

print(cnt)


### FIXED CODE ###

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

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

if a > 8 or b > 8:
    print(":(")
else:
    print("Yay!")
print x**3

### FIXED CODE ###

A=int(input())
print A**3
n=int(input())
l=list(map(int,input().split())
p=l[0]
x=0
for i in range(1,n):
       if l[i]<p:
       		x+=p-l[i]
       elif l[i]>p:
       		p=l[i]
print(x)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
p=l[0]
x=0
for i in range(1,n):
       if l[i]<p:
       		x+=p-l[i]
       elif l[i]>p:
       		p=l[i]
print(x)
N = int(input())
P = list(map(int, input().split()))

mmin = P[0]
ans = 0
for i in range(N):
  if mmin < P[i]:
    continue
  else:
    mmin >= P[i]:
      mmin = P[i]
      ans += 1

print(ans)

### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))
 
mmin = P[0]
ans = 0
for i in range(N):
  if mmin < P[i]:
    continue
  else:
    mmin = P[i]
    ans += 1

print(ans)
import numpy as np
def int_sqrt2(n):
    def f(prev):
        while True:
            m = (prev + n / prev) / 2
            if m >= prev:
                return prev
            prev = m
    
    return f(int(np.sqrt(n) * (1 + 1e-10)))

a,b,c = map(int,input().split())
if int_sqrt2(a)+int_sqrt2(b) < int_sqrt2(c):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from decimal import *
a,b,c = map(str,input().split())
r = "0.5"
if Decimal(a)**Decimal(r)+Decimal(b)**Decimal(r) < Decimal(c) **Decimal(r):
    print("Yes")
else:
    print("No")
A,B,C,D,E,F = map(int,input().split())
c_max = 0
sw_max = 0
s_max = 0

for a in range(F//100*A+1):
    for b in range((F-a*A*100)//100*B+1):
        water = 100*(a*A+b*B)
        limit = F-water
        for c in range(limit//C+1):
            for d in range((limit-c*C)//D+1):

                sugar = c*C + d*D
                
                if water == 0 or sugar == 0:
                    continue
                conc = sugar / (sugar + water)
                if water + sugar <= F and sugar/(water//100) <= E and conc > c_max:
                    c_max = conc
                    sw_max = sugar + water
                    s_max = sugar
if c_max = 0:
    sw_max = 100*A
    s_max=0
print(sw_max,s_max)

### FIXED CODE ###

A,B,C,D,E,F = map(int,input().split())
c_max = 0
sw_max = 0
s_max = 0

for a in range(F//100*A+1):
    for b in range((F-a*A*100)//100*B+1):
        water = 100*(a*A+b*B)
        limit = F-water
        for c in range(limit//C+1):
            for d in range((limit-c*C)//D+1):

                sugar = c*C + d*D
                
                if water == 0 or sugar == 0:
                    continue
                conc = sugar / (sugar + water)
                if water + sugar <= F and sugar/(water//100) <= E and conc > c_max:
                    c_max = conc
                    sw_max = sugar + water
                    s_max = sugar
if c_max ==0:
    sw_max = 100*A
    s_max=0
print(sw_max,s_max)
N = int(input())
lis = [i for i in range(2,55555)]
primes = []
p=1
while(p*p < 55555):
  p = lis.pop(0)
  primes.append(p)
  for num in lis:
    if num%p == 0: lis.remove(num)
primes = primes + lis
print(' '.join(map(str, primes[:N])))

### FIXED CODE ###

a, b = map(int,input().split())
print(a - (b<a))
# AtCorder

s = input() + ""

a = "ACGT"
v = 0
ans = []

for i in s:
    if i in a:
        v += 1
    else:
        if v != 1:
            ans.append(v)
        v = 0

print(max(ans))

### FIXED CODE ###

# AtCorder

s = input()

a = "ACGT"
v = 0
ans = 0

for i in s:
    if i in a:
        v += 1
        ans = max(ans, v)
    else:
        v = 0

print(ans)
N,Y = map(int,input().split())
x = y = z = 0
for i in range(N,-1,-1):
    if i*10000 <= Y:
        charge = Y - i*10000
        rest = N - i
        for j in range(rest,-1,-1):
            if j*5000 <= charge:
                if charge - j*5000 - (rest-j)*1000 == 0:
                    print(f'{i} {j} {rest-j}')
                    exit(1)
print('-1 -1 -1')

### FIXED CODE ###

N,Y = map(int,input().split())
x = y = z = 0
for i in range(N,-1,-1):
    if i*10000 <= Y:
        charge = Y - i*10000
        rest = N - i
        for j in range(rest,-1,-1):
            if j*5000 <= charge:
                if charge - j*5000 - (rest-j)*1000 == 0:
                    print('{0} {1} {2}'.format(i, j ,rest-j))
                    exit(0)
print('-1 -1 -1')
n = int(input())
A = sorted(list(map(int, input().split())))
if len(set(A)) == 1:
    print(0)
    exit()

from collections import Counter
c = Counter(A)

count = 0
NMAX = 2 * 10 ** 5 + 10
L = [True] * (NMAX + 1)
for k, v in c.items():
    p = k
    if L[p]:
        for i in range(p * 2, NMAX + 1, p):
            L[i] = False

for k, v in c.items():
    if v > 1: continue
    if L[k] == True:
        count += 1

print(count)

### FIXED CODE ###

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

from collections import Counter
c = Counter(A)

NMAX = 10 ** 6 + 1000
dp = [True] * (NMAX + 1)

for x in A:
    if not dp[x]:
        continue
    for i in range(x * 2, NMAX + 1, x):
        dp[i] = False
    if c[x] > 1:
        dp[x] = False
    
count = 0
for x in A:
    if dp[x]:
        count += 1

print(count)
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
def banned_count(seq):
    
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            if j >= 2:
                count = count + comb(j, 2, exact=True)
        print(count)
        C[A[i]] += 1
banned_count(A)

### FIXED CODE ###

from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)
N = int(input())
F = [list(map(int,input().split())) for i in range(N)]
P = [list(map(int,input().split())) for i in range(N)]
 
ans = -10**9
for i in range(2**10-1):
  Bit = [1]**10
  for j in range(10):
    if (i>>j)&1:
      Bit[j]=0
  count = 0
  for k in range(N):
    op = sum(b&f for b,f in zip(Bit,F[k]))
    count+=P[k][op]
  ans = max(ans,count)
 
print(ans)

### FIXED CODE ###

N = int(input())
F = [list(map(int,input().split())) for i in range(N)]
P = [list(map(int,input().split())) for i in range(N)]
 
ans = -10**9
for i in range(2**10-1):
  Bit = [1]*10
  for j in range(10):
    if (i>>j)&1:
      Bit[j]=0
  count = 0
  for k in range(N):
    op = sum(b&f for b,f in zip(Bit,F[k]))
    count+=P[k][op]
  ans = max(ans,count)
print(ans)
N = int(input())
P = [None] + list(map(int, input().split()))

p_to_index = [None] * (N + 1)
for index, x in enumerate(P[1:], 1):
    p_to_index[x] = index

#大きい数から挿入
#左隣にあるインデックスを取得できるようにする
#[1, i]内で書き込んだ数の個数を獲得できるBITを構築する

def BIT_add(i):
    while i <= N:
        tree[i] += 1
        i += i & (-i)

def BIT_sum(i):
    s = 0
    while i:
        s += tree[i]
        i -= i & (-i)
    return s

def BIT_search(x):
    i = 0
    s = 0
    step = 1 << (N.bit_length() - 1)
    while step:
        if i + step <= N and s + tree[i + step] < x:
            i += step
            s += tree[i]
        step >>= 1
    return i + 1

tree = [0] * (N + 1)
ans = 0
for x in range(N, 0, -1):
    c = p_to_index[x]
    L = BIT_sum(c) #左側にある既に書き込んだ数の個数
    BIT_add(c)
    R = N - x - L #右側にある既に書き込んだ数の個数
    a = BIT_search(L - 1) if L >= 2 else 0
    b = BIT_search(L) if L >= 1 else 0
    d = BIT_search(L + 2) if R >= 1 else N + 1
    e = BIT_search(L + 3) if R >= 2 else N + 1
    tmp = 0
    if b != 0:
        tmp += (b - a) * (d - c)
    if d != 0:
        tmp += (e - d) * (c - b)
    ans += tmp * x

print (ans)


### FIXED CODE ###

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

index_lst = [0] * N
for index, i in enumerate(P):
    index_lst[i - 1] = index

left_next_Index = list(range(-1, N - 1)) + [-1, -1]
right_next_Index = list(range(1, N + 1)) + [N, N]
# print (left_next_Index)
# print (right_next_Index)
ans = 0
for i in range(1, N):
    index = index_lst[i - 1]
    # print (i, index)
    l1 = left_next_Index[index]
    l2 = left_next_Index[l1]
    r1 = right_next_Index[index]
    r2 = right_next_Index[r1]
    # print ('l1 =', l1, ' l2 =', l2, ' r1 =', r1, ' r2 =', r2)
    ans += i * ((index - l1) * (r2 - r1) + (r1 - index) * (l1 -l2))

    left_next_Index[r1] = l1
    right_next_Index[l1] = r1

print (ans)
def main():
	H, W, D = map(int,input().split())
	pos = [0]*(H*W+1)
	for i in range(H):
		A = list(map(int, input().split()))
		for j in range(W):
			pos[A[j]] = [i, j]
	Q = int(input())
	lr = [0]*Q
	for i in range(Q):
		lr[i] = list(map(int, input().split()))
	ans = dict()
	for i in range(1, H*W+1-D):
		pre = i
		cur = i
		d = 0
		while cur < H*W+1:
			pre_pos = pos[pre]
			cur_pos = pos[cur]
			d += abs(pre_pos[0]-cur_pos[0])+abs(pre_pos[1]-cur_pos[1])
			ans[(i, cur)] = d
			pre = cur
			cur += D
	for i in range(Q):
		print(ans[(lr[i][0], lr[i][1])])


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
	H, W, D = map(int,input().split())
	pos = [0]*(H*W)
	for i in range(H):
		A = list(map(int, input().split()))
		for j in range(W):
			pos[A[j]-1] = [i, j]
	Q = int(input())
	lr = [0]*Q
	for i in range(Q):
		lr[i] = list(map(int, input().split()))
	ans = [[0] for _ in range(D)]
	for i in range(H*W-D):
		s_pos = pos[i]
		e_pos = pos[i+D]
		d = abs(s_pos[0]-e_pos[0])+abs(s_pos[1]-e_pos[1])
		ans[i%D].append(ans[i%D][-1]+d)
	for i in range(Q):
		s = lr[i][0]-1
		e = lr[i][1]-1
		print(ans[e%D][e//D]-ans[s%D][s//D])


if __name__ == '__main__':
    main()
a,b,c=stdin.readline().rstrip().split()
if a==b:
  print(c)
elif a==c:
  print(b)
elif b==c:
  print(a)

### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b:
  print(c)
elif a==c:
  print(b)
elif b==c:
  print(a)
n=int(input()
ans=0
for i in range(1,n+1):
    ans+=i
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n+1):
    ans+=i
print(ans)
a,b=map(int,input().split)
if (a*b)%2:
print("Odd")
else:
print("Even")


### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
s=input()
k=int(input())
a=[]
for i in range(len(s)):
    for j in range(i+1, min(i+k, len(s)+1)):
        a.append(s[i:j])
b=list(set(a))
b.sort()
print(b[k-1])

### FIXED CODE ###

s=input()
k=int(input())
substrings=set()
for i in range(len(s)):
    for j in range(5):
        if i+j<len(s):
            substrings.add(s[i:i+j+1])
substrings=sorted(list(substrings))
print(substrings[k-1])
import sys
def solve(a,b,lst_ab):
    li = [abs(b-(a-(i*0.006))) for i in lst_ab]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return print(answer)

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    line2 = sys.stdin.readline().rstrip()
    list1 = line2.split(" ")
    line3 = sys.stdin.readline().rstrip()
    list2 = line3.split(" ")
    return int(list1[0]),int(list1[1]),list2
 
def main():
    t,a,h = readQuestion()
    answer = solve(t,a,h)
    print(answer)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

def solve(N, T, A, ls_H):
    li = [abs(A-(T-(i*0.006))) for i in ls_H]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return answer

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

main()
A, B, C = map(int, input().split(" "))
cnt = 0

if (A%2 == B%2) and (B%2 == C%2):
    pass
else:
    if A%2 == B%2:
        A += 1
        B += 1
        cnt += 1
    elif A%2 == C%2:
        A += 1
        C += 1
        cnt += 1
    else:
        B += 1
        C += 1
        cnt += 1

ABC = sorted([A, B, C])
cnt += (ABC[0] - ABC[1]) / 2
cnt += (ABC[0] - ABC[2]) / 2
print cnt

### FIXED CODE ###

A, B, C = map(int, input().split(" "))
cnt = 0

if (A%2 == B%2) and (B%2 == C%2):
    pass
else:
    if A%2 == B%2:
        A += 1
        B += 1
        cnt += 1
    elif A%2 == C%2:
        A += 1
        C += 1
        cnt += 1
    else:
        B += 1
        C += 1
        cnt += 1

ABC = sorted([A, B, C])
cnt += (ABC[2] - ABC[1]) // 2
cnt += (ABC[2] - ABC[0]) // 2
print(cnt)
a =map(int,raw_input().split())
if a[0]>a[1]:
        print "a>b"
elif a[0]<a[1]:
        print "a<b"
else:
        print "a==b"
~                       

### FIXED CODE ###

a =map(int,raw_input().split())
if a[0]>a[1]:
        print "a > b"
elif a[0]<a[1]:
        print "a < b"
else:
        print "a == b"
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
a = []
for i in xrange(M):
    a.append(map(int, raw_input().split()))

s1=set()
s2=set()
for i in xrange(M):
    if a[i][0]==1:
        s1.add(a[i][1])
    if a[i][1]==N:
        s2.add(a[i][0])
if s1 & s2:
    print 'POSSIBLE'
else:
    print 'IMPOSSIBLE'

else:
 print 'IMPOSSIBLE'

### FIXED CODE ###

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

N, M = map(int, raw_input().split())
a = []
for i in xrange(M):
    a.append(map(int, raw_input().split()))

s1=set()
s2=set()
for i in xrange(M):
    if a[i][0]==1:
        s1.add(a[i][1])
    if a[i][1]==N:
        s2.add(a[i][0])
if s1 & s2:
    print 'POSSIBLE'
else:
    print 'IMPOSSIBLE'
P,Q,R=map(int,input().split())
T=list(P,Q,R)
T.sort()
print(T[0]+T[1])

### FIXED CODE ###

T=list(map(int,input().split()))
T.sort()
print(T[0]+T[1])
a,b,c=map(int,input().split())
k=int(input())
for i in range(k+1):
    if a>b:
        b=b*2
    else:
        if b>c:
            c=c*2
        else:
            break

if a<b<c:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s=int(input())
if 400<=s<=599:
    print('8')
elif 600<=s<=799:
    print('7')
elif 800<=s<=999:
    print('6')
elif 1000<=s<=1199:
    print('5')
elif 1200<=s<=1399:
    print('4')
elif 1400<=s<=1599:
    print('3')
elif 1600<=s<=1799:
    print('2')
elif 1800<=s<=1999:
    print('1')