Harryxun/stf_run huggingface dataset:
a,b,c,k = map(int,input().split())
if k < a:
  print(k)
elif a <= k and k < a+b:
  print(a)
else:
  print(a-(k-a-b))

### FIXED CODE ###

s = input()
t = input()
if s == t[:-1]:
  print("Yes")
else:
  print("No")
r = int(input())
return 3 * r ** 2 

### FIXED CODE ###

r = int(input())
print(3 * r ** 2 )
s=str(input())
s[3]="8"
print(s)

### FIXED CODE ###

s=str(input())
s=s.replace("2017","2018")
print(s)
x = int(input())
if x = 1:
  print("0")
if x = 0:
  print("1")

### FIXED CODE ###

x = input()
x = int(x)
if x == 1:
    print("0")
else:
    print("1")
n = int(input())
print('math.ceil(n/2)/n）

### FIXED CODE ###

import math
n = int(input())
print(math.ceil(n/2)/n)
def rec(i):
    if i == 0:
        C[i] = 0
        return C[i]
    elif i == 1:
        C[i] = rec(i-1)+abs(H[i]-H[i-1])
        return C[i]
    # print(i, rec(i-1), rec(i-2))
    C[i] = min(rec(i-1)+abs(H[i]-H[i-1]), rec(i-2)+abs(H[i]-H[i-2]))
    return C[i]
INFTY = 10**13
N = int(input())
H = list(map(int, input().split()))
C = [INFTY for i in range(N)]
# C[0] = 0
# for i in range(N):
#     if i+1 < N:
#         C[i+1] = min(C[i] + abs(H[i+1]-H[i]), C[i+1])
#     if i+2 < N:
#         C[i+2] = min(C[i] + abs(H[i+2]-H[i]), C[i+2])
# print(C[-1])
print(rec(N-1))


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
C = [10**13 for i in range(N)]
C[0] = 0
for i in range(N):
    if i+1 < N:
        C[i+1] = min(C[i] + abs(H[i+1]-H[i]), C[i+1])
    if i+2 < N:
        C[i+2] = min(C[i] + abs(H[i+2]-H[i]), C[i+2])
print(C[-1])
pb_list = []
p_count = 0

def pb(n):
    if n == 0:
        pb_list.append('p')
        p_count = p_count + 1
        return
    elif n >= 0:
        pb_list.append('b')
        pb(n - 1)
        pb_list.append('p')
        p_count = p_count + 1
        pb(n - 1)
        pb_list.append('b')
    else:
        return

n, x = input().split(' ')
n = int(n)
x = int(x)
pb(n)

#for i in range(x):
#    if pb_list[i] == 'p':
#        p_count = p_count + 1

print(p_count)

### FIXED CODE ###

c = int(input())

if c == 25:
    print("Christmas")
elif c == 24:
    print("Christmas Eve")
elif c == 23:
    print("Christmas Eve Eve")
elif c == 22:
    print("Christmas Eve Eve Eve")
else:
    pass
N,K = map(int,input().split())
D = {}
for i in range(N):
    D[i+1] = 0
for i in range(K):
    d = input()
    A = list(map(int,input().split()))
    for a in A:
        d[a] += 1
ans = 0
for i in range(N):
    if D[i+1] == 0:
        ans += 1
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
D = {}
for i in range(N):
    D[i+1] = 0
for i in range(K):
    d = input()
    A = list(map(int,input().split()))
    for a in A:
        D[a] += 1
ans = 0
for i in range(N):
    if D[i+1] == 0:
        ans += 1
print(ans)
N = int(input())
max = 0

init = list(range(1, N+1))
all = []


def helper(input):
    if len(input) == N:
        all.append([i for i in list])
        return

    for i in range(1, N+1):
        if i not in input:
            input.append(i)
            helper(input)
            input.pop()


list = []
helper(list)

for i in all:
    sum = 0
    for j in range(N):
        sum += i[j] % (j+1)
    if sum > max:
        max = sum

print(max)


### FIXED CODE ###

N = int(input())
max = 0


print((N-1)*N//2)
import sys
import numpy as np
input = lambda: sys.stdin.readline().rstrip()


def solve():
    N = int(input())
    A = np.array(list(map(int, input().split())), dtype='i8')
    A = A.reshape((1, N))
    B = np.zeros((N, N), dtype='i8')
    for i in range(N):
        B[i][i - N] = 1
        B[i][i + 1 - N] = 1

    ans = np.dot(np.linalg.inv(B), (A * 2).T)
    ans = ' '.join(map(str, list(map(int, ans.flatten().tolist()))))
    print(ans)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
import numpy as np
input = lambda: sys.stdin.readline().rstrip()


def solve():
    N = int(input())
    A = np.array(list(map(int, input().split())), dtype='i8')
    ans = np.zeros(N, dtype='i8')
    A = A * 2
    s = np.sum(A) // 2

    na1 = 0
    for i in range(1, N, 2):
        na1 += A[i]

    ans[0] = s - na1
    for i in range(N - 1):
        ans[i + 1] = A[i] - ans[i]

    print(' '.join(map(str, ans.tolist())))


if __name__ == '__main__':
    solve()
S = list(input())
Q = int(input())
x = 1
l=[]
for i in range(Q):
    l = list(input().split())
    if l[0] == "1":
        x *= -1
    elif l[0] == "2":
        if (l[1] == "2" and x == -1) or  (l[1] == "1" and x == 1):
            S.insert(0, d)
        else:
            S.append(d)
if x == -1:
    S = S[::-1]
print(*S, sep="")

### FIXED CODE ###

from collections import deque
S = deque(input())
Q = int(input())
x = 1
l=[]
for i in range(Q):
    a, *b = input().split()
    if a == "1":
        x *= -1
    elif a == "2":
        c, d = b
        if (c == "2" and x == -1) or  (c == "1" and x == 1):
            S.appendleft(d)
        else:
            S.append(d)
if x == -1:
    S.reverse()
print(*S, sep="")
print max(X-t, 0)

### FIXED CODE ###

X, t = map(int, raw_input().split())
print max(X-t, 0)
n = input()
if n%2==0:
    print(int(n/2))
else:
    print(int(n/2)+1)

### FIXED CODE ###

n = int(input())
if n%2==0:
    print(int(n/2))
else:
    print(int(n/2)+1)
Alice,Bob = map(int,input().split())
if Alice = 1:
    ALice = 14
if Bob = 1:
    Bob = 14
if Alice>Bob:
    print('Alice')
elif Alice==Bob:
    print('Draw')
else:
    print('Bob')


### FIXED CODE ###

Alice,Bob = map(int,input().split())
if Alice == 1:
    Alice = 14
if Bob == 1:
    Bob = 14
if Alice>Bob:
    print('Alice')
elif Alice==Bob:
    print('Draw')
else:
    print('Bob')
n=int(input())
x=n/1.08
nn=x*1.08
if n<=nn<n+1:
    if x*10%10>=5:    
		print(int(x)+1)
    else:
        print(int(x))
else:
  print(":(")


### FIXED CODE ###

import math
n=int(input())
xc=math.ceil(n/1.08)
nn=xc*1.08
if math.floor(nn)==n:    
	print(xc)
else:
  print(":(")
a=list(int(input(),split()))
b=list(int(input(),split()))

s=(a[0]-b[0])*(a[1]-b[1])
print(s)

### FIXED CODE ###

a=list(map(int,input().split()))
b=list(map(int,input().split()))
print((a[0]-b[0])*(a[1]-b[1]))
A = input()
B = input()

print(A * B)

### FIXED CODE ###

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

print(a*b)
import sys

D = int(input())
if D = 22:
  output("Christmas Eve Eve Eve")
if D = 23:
  output("Christmas Eve Eve")
if D = 24:
  output("Christmas Eve")
if D = 25:
  output("Christmas")

  

### FIXED CODE ###

import sys
 
D = int(input())
if D == 22:
  print("Christmas Eve Eve Eve")
if D == 23:
  print("Christmas Eve Eve")
if D == 24:
  print("Christmas Eve")
if D == 25:
  print("Christmas")
while True:
    n = input()
    if n == 0:
        break
    dic = {}
    for _ in xrange(n):
        name, cost = raw_input().split()
        dic[name] = int(cost)
    for _ in xrange(input()):
        items = raw_input().split()
        if items[1] == 0:
            continue
        dic[items[0]] = min(dic[items[0]], sum(map(lambda x:dic[x], items[2:])))
    print dic[raw_input()]

### FIXED CODE ###

INF = 1 << 29
while True:
    n = input()
    if n == 0:
        break
    dic = {}
    for _ in xrange(n):
        name, cost = raw_input().split()
        dic[name] = int(cost)
    m = input()
    recipe = []
    for _ in xrange(m):
        data = raw_input().split()
        if data[1] <= 0:
            m -= 1
            continue
        recipe.append([data[0]]+data[2:])
    for _ in xrange(m):
        for i in xrange(m):
            dic[recipe[i][0]] = min(dic[recipe[i][0]] if recipe[i][0] in dic else INF, 
                                    sum(map(lambda x:dic[x] if x in dic else INF, recipe[i][1:])))
    print dic[raw_input()]
n=int(input())
l=sorted(list(map(int,input().split())) for nd in range(n),key=lambda x:x[1])
now=0
for a,s in l:
  if a+now>s:print("No");exit()
  now+=a
else:print("Yes")


### FIXED CODE ###

n=int(input())
l=sorted([list(map(int,input().split())) for nd in range(n)],key=lambda x: x[1])
now=0
for a,s in l:
  if a+now>s:print("No");exit()
  now+=a
else:print("Yes")
import sys
sys.setrecursionlimit(10 ** 6)

# to enable variable use in global
global tree, point

# v : current node, f : parent node 
def dfs(v, f):
    for next_v in tree[v]:
        if next_v == f:
            continue
    
        point[next_v] += point[v]
        dfs(next_v, v)

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

for _ in range(Q):
    p , x = map(int, input().split())
    p = x - 1
    point[p] += x

dfs(0, 0)
print(*point)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

# to enable variable use in global
global tree, point

# v : current node, f : parent node 
def dfs(v, f):
    global tree, point
    for next_v in tree[v]:
        if next_v == f:
            continue
    
        point[next_v] += point[v]
        dfs(next_v, v)

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

for _ in range(q):
    p , x = map(int, input().split())
    point[p - 1] += x

dfs(0, 0)
print(*point)
from functools import lru_cache

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

e_list = [[] for i in range(N)]

for i in range(M):
    x,y = list(map(int,input().split()))
    x,y = x-1,y-1
    e_list[x].append(y)

@lru_cache(maxsize=200000)
def DFS(v):
    if len(e_list[v])==0:
        return 0
    res = 0
    for v1 in e_list[v]:
        res1 = DFS(v1)
        if res<res1+1:
            res = res1+1
    return res

ans = 0
for i in range(N):
    res = DFS(i)
    
    if res>ans:
        ans = res
print(ans)

### FIXED CODE ###

import sys

sys.setrecursionlimit(500000)


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

e_list = [[] for i in range(N)]

for i in range(M):
    x,y = list(map(int,input().split()))
    x,y = x-1,y-1
    e_list[x].append(y)

memo = [-1]*N

def DFS(v):
    if memo[v]!=-1:
        return memo[v]
    if len(e_list[v])==0:
        memo[v] = 0
        return 0
    res = 0
    for v1 in e_list[v]:
        res1 = DFS(v1)
        if res<res1+1:
            res = res1+1
    memo[v] = res
    return res

ans = 0
for i in range(N):
    res = DFS(i)
    if res>ans:
        ans = res
print(ans)
def solve():
    import sys
    from itertools import combinations
    input_lines = sys.stdin.readlines()
    while True:
        N = int(input_lines[0])
        if N == 0:
            break
        distance = []
        for t1, t2 in combinations(input_lines[1:N+1], 2):
            r1, x1, y1 = map(float, t1.split())
            r2, x2, y2 = map(float, t2.split())
            d = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 -r1 - r2
            distance.append(d)
        print(min(distance))
        del input_lines[:N+1]

solve()


### FIXED CODE ###

def _get_distance(c1, c2):
    return ((c1[1] - c2[1]) ** 2 + (c1[2] - c2[2]) ** 2) ** 0.5 - c1[0] - c2[0]

from itertools import combinations

def _get_min_distance(circles):
    min_d = float("inf")
    for c1, c2 in combinations(circles, 2):
        min_d = min(min_d, _get_distance(c1, c2))
    return min_d

def closest_pair_distance(circles, axis =1):
    # axis: x; 1, y; 2
    n = len(circles)
    if n <= 3:
        return _get_min_distance(circles)
    else:
        mid = n // 2
        r, x, y = zip(*circles)
        
        if len(set(x)) > len(set(y)):
            if axis == 2:
                circles.sort(key = lambda c: c[1] - c[0])
            axis1 = 1
            axis2 = 2
        else:
            if axis == 1:
                circles.sort(key = lambda c: c[2] - c[0])
            axis1 = 2
            axis2 = 1
        
        A_circles = circles[:mid]
        B_circles = circles[mid:]
        
        d_Amin = closest_pair_distance(A_circles.copy(), axis1)
        d_Bmin = closest_pair_distance(B_circles.copy(), axis1)
        dist = min(d_Amin, d_Bmin)
        min_d = dist
        
        A_circles.sort(key = lambda c: c[axis] + c[0])
        B_edge = B_circles[0][axis1] - B_circles[0][0]
        for ac in A_circles[::-1]:
            ac_r = ac[0]
            ac_edge = ac[axis1] + ac_r
            if B_edge - ac_edge >= dist:
                break
            for bc in B_circles:
                bc_r = bc[0]
                if bc[axis1] - bc_r - ac_edge >= dist:
                    break
                if abs(ac[axis2] - bc[axis2]) - ac_r - bc_r < dist:
                    min_d = min(min_d, _get_distance(ac, bc))
        return min_d

# solve
def solve():
    import sys
    input_lines = sys.stdin.readlines()
    while True:
        N = int(input_lines[0])
        if N == 0:
            break
        circles = [tuple(map(float, l.split())) for l in input_lines[1:N+1]]
        print('{:.8f}'.format(closest_pair_distance(circles)))
        del input_lines[:N+1]

solve()
a, b, c = [ int(v) for v in input().split() ]

if all([a==b,b==c]):
    print(-1)

else:
    t = 0
    while:
        a, b, c = map( int,[ b/2+c/2, c/2+a/2, a/2+b/2 ] )
        t += 1

        if not all([a%2==0,b%2==0,c%2==0]):
            print(t)
            break
        if all([a==b,b==c]):
            print(-1)
            break
        

### FIXED CODE ###

a, b, c = [ int(v) for v in input().split() ]
t = 0

if not all([a%2==0,b%2==0,c%2==0]):
    print(t)
elif all([a==b,b==c]):
    print(-1)


else:
    while True:
        a, b, c = map( int,[ b/2+c/2, c/2+a/2, a/2+b/2 ] )
        t += 1

        if not all([a%2==0,b%2==0,c%2==0]):
            print(t)
            break
        elif all([a==b,b==c]):
            print(-1)
            break
import itertools
x = int(input())
n = 70
table = [pow(i, 5) for i in range(-n, n+1)]
choices = list(itertools.permutations([i for i in range(len(table))], 2))
for choice in choices:
    left = choice[0]
    right = choice[1]
    if table[left] - table[right] == x:
        if left == n:
            ans_left = 0
        elif left < n:
            ans_left = left - n
        else:
            ans_left = left % n
            
        if right == n:
            ans_right = 0
        elif right < n:
            ans_right = right - n
        else:
            ans_right = right % n
        break
print(ans_left, ans_right)

### FIXED CODE ###

import itertools

x = int(input())
n = 200
table = [pow(i, 5) for i in range(-n, n+1)]
choices = list(itertools.product([i for i in range(len(table))], repeat=2))

for choice in choices:
    left = choice[0]
    right = choice[1]
    if table[left] - table[right] == x:
        if left == n:
            ans_left = 0
        elif left < n:
            ans_left = left - n
        else:
            ans_left = left % n
            
        if right == n:
            ans_right = 0
        elif right < n:
            ans_right = right - n
        else:
            ans_right = right % n
        break

print(ans_left, ans_right)
import bisect from bisect_left
N,M,X = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
b = bisect_left(A,X)
print(min(b,N-1-B))

### FIXED CODE ###

from bisect import bisect_left
N,M,X = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
b = bisect_left(A,X)
if b==0:
  print(0)
  exit()
print(min(b,M-b))
class UnionFind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
    def find(self, x):
        if self.parent[x] == x:
            return x
        self.parent[x] = self.find(self.parent[x])
        return self.parent[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        self.parent[x] = y

def main():
    N, M = map(int, input().split())
    uf = UnionFind(N)
    for i in range(M):
        X, Y, Z = map(int, input().split())
        uf.union(X-1, Y-1)
    s = set()
    for i in range(N):
        s.add(uf.find(i))
    print(len(s))

if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    main()


### FIXED CODE ###

import sys

class UnionFind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
    def find(self, x):
        if self.parent[x] == x:
            return x
        self.parent[x] = self.find(self.parent[x])
        return self.parent[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        self.parent[x] = y

def main():
    N, M = map(int, input().split())
    uf = UnionFind(N)
    for i in range(M):
        X, Y, Z = map(int, input().split())
        uf.union(X-1, Y-1)
    s = set()
    for i in range(N):
        s.add(uf.find(i))
    print(len(s))

if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    main()
input = get_input(INPUT)

h, w = map(int, input().split())
a = [input() for w in range(h)]

for i in range(h)[::-1]:
    if "#" not in a[i]:
        del a[i]
        h -= 1

n = []
for j in range(w):
    m = ["".join(t[j] for t in a)]
    if "#" in m[0]:
        n += m

for k in range(h):
    print("".join(u[k] for u in n))

### FIXED CODE ###

h, w = map(int, input().split())
a = [input() for w in range(h)]

for i in range(h)[::-1]:
    if "#" not in a[i]:
        del a[i]
        h -= 1

n = []
for j in range(w):
    m = ["".join(t[j] for t in a)]
    if "#" in m[0]:
        n += m

for k in range(h):
    print("".join(u[k] for u in n))
n=input()
for i in range(len(n)):
  if n[i]=="1"or"9":
    if n[i]=="1":
      n[i]="9"
    else:n[i]=="1"
print(int(n))
    

### FIXED CODE ###

x=input()
n=[x[i] for i in range(len(x))]
for i in range(len(n)):
  if n[i]=="1":
    n[i]="9"
  elif n[i]=="9":
    n[i]="1"
print(int("".join(n)))
n, q = map(int, input().split())
g = [ [] for _ in range(n) ]
for _ in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)

pl = [0] * n
for _ in range(q):
    p, x = map(int, input().split())
    pl[p-1] = x


def dfs(curr, pare):
    for chi in g[curr]:
        if chi == pare: continue
        pl[chi] += pl[curr]
        dfs(chi, curr)

def main():
    dfs(0,-1)
    print(pl)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, q = map(int, input().split())
g = [ [] for _ in range(n) ]
for _ in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)

pl = [0] * n
for _ in range(q):
    p, x = map(int, input().split())
    pl[p-1] += x


def dfs(curr, pare):
    for chi in g[curr]:
        if chi == pare: continue
        pl[chi] += pl[curr]
        dfs(chi, curr)

def main():
    dfs(0,-1)
    print(*pl)

if __name__ == "__main__":
    main()
N = int(input())
A = list(map(int, input().split()))

ans = 0
n = [0] * 10005
for i in range(N):
    n[A[i]] += 1
    ans += A[i]
Q = int(input())
for i in range(Q):
    b, c = map(int, input().split())
    ans += c * n[b] - b * n[b]
    print(ans)
    n[c] += n[b]
    n[b] = 0


### FIXED CODE ###

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

ans = 0
n = [0] * 100005
for i in range(N):
    n[A[i]] += 1
    ans += A[i]
Q = int(input())
for i in range(Q):
    b, c = map(int, input().split())
    ans += c * n[b] - b * n[b]
    print(ans)
    n[c] += n[b]
    n[b] = 0
a, b, k = map(int,input().split())
if a >= k:
    ans = [a-k,b]
else:
    ans = [0,a+b-k]
print(str(ans[0]+" "+str(ans[1])))

### FIXED CODE ###

# coding: utf-8
# Your code here!

a, b, k = map(int,input().split())
if a >= k:
    ans = [a-k,b]
elif a+b >=k:
    ans = [0,a+b-k]
else :
    ans = [0,0]
print(str(ans[0])+" "+str(ans[1]))
N = list(input())
K = int(input())
for i in range(len(K)) :
  a = int(i)
  if a!=1:
    print(a)
    exit()
print(1)

### FIXED CODE ###

N = list(input())
K = int(input())
for i in range(K) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(1)
import sys

input = sys.stdin.readline

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

def eval(N,S):
    total=0
    for i in range(1,N):
        if S[i]==S[i-1]:total+=1
    return total

start_num=1
  
for k in range(K):
    if S==['R']*N or S==['L']*N:break
    j=[]
    start_num=j[1]+1
    for i in range(start_num, N):
        if S[i-1]!=S[i]:
            j.append(i)
            if len(j)==2:break
    if len(j)==1:j.append(N)
    if S[j[0]]=='R':
        S[j[0]:j[1]]=['L']*(j[1]-j[0])
    else:S[j[0]:j[1]]=['R']*(j[1]-j[0])
print(eval(N,S))
  


### FIXED CODE ###

import sys
from collections import deque

input = sys.stdin.readline

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

sq = deque(S)
lst=[]
j=0

for i in range(K):
    j=0
    if not sq:break
    sq_1st = sq.popleft()
    sq_2nd = sq_1st
    lst.append(sq_1st)

    while sq:
        sq_3rd = sq.popleft()
        if sq_2nd!=sq_3rd:
            j+=1
            sq_2nd=sq_3rd
            if j==2:
                sq.appendleft(sq_3rd)
                break
        lst.append(sq_1st)

lst+=list(sq)             

def eval(N,S):
    total=0
    for i in range(1,N):
        if S[i]==S[i-1]:total+=1
    return total
  
print(eval(N,lst))
n,a,b = map(int,input().split())
print(min(n*a),b)

### FIXED CODE ###

n,a,b = map(int,input().split())
print(min(n*a,b))
n = int(input())
A = list(map(int,input().split()))
ans = 1
for a in A:
  if a % 2 == 0:
    if a % 3 != 0 or a % 5 != 0:
      ans = 0
      break()
      
if ans:
  print(APPROVED)
else:
  print(DENIED)
  



### FIXED CODE ###

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

POINT = 0
for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 10 != 0:
            POINT = 1
if POINT == 1:
  print("DENIED")
else:
  print("APPROVED")
import math
a,b = [int(x) for x in input().split()]
 
print(math.ceil((a+b)/2)

### FIXED CODE ###

import math
a,b = [int(x) for x in input().split()]
 
print(math.ceil((a+b)/2))
from collections import deque

N,M=map(int,input().split())
G=[[] for _ in range(N+1)]
for i in range(M):
  a,b=map(int,input().split())
  G[a].append(b)
  G[b].append(a)

ans=[0]*(N+1)
d=deque([1])
while d:
  c=d.popleft()
  for g in G[c]:
    if not ans[g]:
      d.append(g)
      ans[g]=c

print('Yes')
for i in range(2, N+1):
  print(ans[i])

### FIXED CODE ###

import math

A, B, H, M = map(int, input().split())

# for one minute
A_deg=H*(360/12) + M*(360/12/60)
B_deg=M*(360/60)
deg=abs(A_deg-B_deg)

ans = math.sqrt(
  A**2+
  B**2-
  2*A*B*math.cos(math.radians(deg))
)

print(ans)
k,x = map(int,input().solit())
result = []
for i in range(x-k+1, x+k-1):
  result.append(i)
for s in result:
  print(s, end =" ")

### FIXED CODE ###

k,x = map(int,input().split())
result = []
for i in range(x-k+1, x+k):
  result.append(i)
for s in result:
  print(s, end =" ")
s=input()
con=[0]*2
for i in raange(4):
    if s[i]=='+':
        c[0]+=1
     else:
         c[1]+=1
print(c[0]-c[1])           

### FIXED CODE ###

s=input()
con=[0]*2
for i in range(4):
    if s[i]=='+':
        con[0]+=1
    else:
        con[1]+=1
print(con[0]-con[1])
n = int(input())
l = []
for i in range(n):
    sp = input().split()
    l.append((sp[0], int(sp[1]), i+1))

a = sorted(l, key=lambda i: (i[0], -l[1]))

for i in range(n):
    print(a[i][2])

### FIXED CODE ###

n = int(input())
l = []
for i in range(n):
    sp = input().split()
    l.append((sp[0], int(sp[1]), i+1))

a = sorted(l, key=lambda i: i[1], reverse=True)
a = sorted(a, key=lambda i: i[0])

for i in range(n):
    print(a[i][2])