Harryxun/stf_run huggingface dataset:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

ans = (A - B) / (W - V)

print("YES" if ans <= T else "NO")

### FIXED CODE ###

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if A <= B:
    print("YES" if A + V * T >= B + W * T else "NO")
else:
    print("YES" if A - V * T <= B - W * T else "NO")
s = input()
k = int(input())

a = list(s)
a = [ord(i) for i in a]
b = sorted(a)
m = b[0]
n = 0
c = []
INF = 97+26
while len(c) < k:
    a1 = [i for i in range(len(s)) if a[i] == m]
    while b[n] == m:
        n += 1
    m = b[n]
    for i in a1:
        j = 0
        while i+j < len(s):
            if s[i:i+j+1] not in c:
                c.append(s[i:i+j+1])
            j += 1

c.sort()
print(c[k-1])


### FIXED CODE ###

s = input()
k = int(input())

a = list(s)
a = [ord(i) for i in a]
b = sorted(set(a))
c = []
INF = 97+26
for m in b:
    a1 = [i for i in range(len(s)) if a[i] == m]

    for i in a1:
        j = 0
        for j in range(k):
            if s[i:i+j+1] not in c:
                c.append(s[i:i+j+1])
                c.sort()
            if len(c) > 5:
                del c[-1]
            j += 1
            if i + j >= len(s):
                break
    if len(c) >= k:
        break

print(c[k-1])
n, k = map(int, input().split())
a = list(map(int, input().split()))

a1 = sorted(a)
a2 = []
count = 0
for i in range(n - 1):
    if a1[i] == a1[i + 1]:
        count += 1
    else:
        a2.append(count)
        break
a2.append(count)
l = sorted(a2)
print(sun(l[:len(l) - k - 1]))

### FIXED CODE ###

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

a1 = sorted(a)
a2 = []
count = 1
for i in range(n - 1):
    if a1[i] == a1[i + 1]:
        count += 1
    else:
        a2.append(count)
        count = 1
a2.append(count)
l = sorted(a2)
print(sum(l[:len(l) - k]))
from collections import deque
import sys


def bfs(x1, y1, d):
    q = deque()
    q.append((d, x1, y1))

    while q:
        d, x1, y1 = q.popleft()

        M[x1][y1] = d

        if [x1, y1] == [xg, yg]:
            return

        for dx, dy in ((0, 1), (1, 0), (0, -1), (-1, 0)):
            for k in range(1, K + 1):
                x2 = x1 + dx * k
                y2 = y1 + dy * k

                if (0 <= x2 < H) and (0 <= y2 < W):
                    if m[x2][y2] == "@":
                        break
                    elif M[x2][y2] == -1:
                        M[x2][y2] = d + 1
                        q.append((x2, y2, d + 1))  # 新しい点を足す。
                    elif M[x2][y2] < d + 1:
                        break
                else:
                    break


H, W, K = map(int, input().split())
# K = min(K, max(H, W))
xs, ys, xg, yg = map(int, input().split())
xs, ys, xg, yg = xs - 1, ys - 1, xg - 1, yg - 1

m = []
for i in range(H):
    m.append(list(map(str, sys.stdin.readline().strip())))

M = [[-1] * W for i in range(H)]

bfs(xs, ys, 0)

print(M[xg][yg])


### FIXED CODE ###

from collections import deque


def bfs(maze, visited, sy, sx, gy, gx):
    queue = deque([[sy, sx]])
    visited[sy][sx] = 0
    while queue:
        # queueには訪れた地点が入っている。そこから、4方向に移動できるか考え、queueから消す。
        y, x = queue.popleft()  # queueに入っていたものを消す。
        if [y, x] == [gy, gx]:  # もしゴールについていたならば、そのときの手数を出す。
            return visited[y][x]
        for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
            l = 1
            while True:
                new_y, new_x = y + j * l, x + k * l
                if (0 <= new_y < H) and (0 <= new_x < W):
                    if maze[new_y][new_x] == "@":
                        break
                    elif visited[new_y][new_x] == -1:  # まだ来たことない点だったという条件
                        visited[new_y][new_x] = visited[y][x] + 1
                        queue.append([new_y, new_x])  # 新しい点を足す。
                    elif visited[new_y][new_x] < visited[y][x] + 1:
                        break
                else:
                    break
                l += 1
                if l == K + 1:
                    break


H, W, K = map(int, input().split())
# K = min(K, max(H, W))
x1, y1, x2, y2 = map(int, input().split())
x1, y1, x2, y2 = x1 - 1, y1 - 1, x2 - 1, y2 - 1
C = [0] * H
for i in range(H):
    C[i] = str(input())
visited = [[-1] * W for i in range(H)]
bfs(C, visited, x1, y1, x2, y2)
# print(visited)
print(visited[x2][y2])
x = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

ans = None
d_ls = make_divisors(x)
for d in d_ls:
    for a in range(0, 100):
        b = a-d
        c = a**5-b**5
        if c==x:
          ans = (a, b)
          break
    if ans is not None:
      break
print(ans[0], ans[1])

### FIXED CODE ###

x = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

ans = None
d_ls = make_divisors(x)
for d in d_ls:
    for a in range(0, 1000):
        b = a-d
        c = a**5-b**5
        if c==x:
          ans = (a, b)
          break
    if ans is not None:
      break
print(ans[0], ans[1])
n=int(input())
a,b=[s for s in input().split()]
c=None
for i in range(n):
  c=c+a[i]+b[i]
  
print(c)  

### FIXED CODE ###

n=int(input())
a,b=[s for s in input().split()]
c=''
for i in range(n):
  c=c+a[i]+b[i]
  
print(c)
N = int(input())
D = list(map(int,input().split()))
_mod = 998244353

a = [0 for _ in range(N)]

for d in D:
  a[d] += 1

ans = 0

if a[0] != 1 or d[0] != 0:
  print(ans)
  exit()

cnt = 0
for i in range(N):
  cnt += a[i]
  if i == 0:
    ans = 1
  else:
    if a[i] == 0:
      if cnt == N:
        break
      else:
        ans = 0
    else:
      temp = a[i-1] ** a[i]
      ans = (ans * temp ) % _mod

print(ans)






### FIXED CODE ###

N = int(input())
D = list(map(int,input().split()))
_mod = 998244353

a = [0 for _ in range(N)]

for d in D:
  a[d] += 1

ans = 0

if a[0] != 1 or D[0] != 0:
  print(ans)
  exit()

cnt = 0
for i in range(N):
  cnt += a[i]
  if i == 0:
    ans = 1
  else:
    if a[i] == 0:
      if cnt == N:
        break
      else:
        ans = 0
    else:
      temp = a[i-1] ** a[i]
      ans = (ans * temp ) % _mod

print(ans)
n = int(raw_input())
a = []
for i in range(n):
    a.append(int(raw_input()))

max = a[1] - a[0]
min_num = a[0]
for i in a:
    if a[i] - min_num > max:
        max = a[i] - min_num
    if min_num > i:
        min_num = i
print max

### FIXED CODE ###

n = int(raw_input())
a = []
for i in range(n):
    a.append(int(raw_input()))

max = a[1] - a[0]
min_num = a[0]
for i in a[1:]:
    if i - min_num > max:
        max = i - min_num
    if min_num > i:
        min_num = i
print max
N = input().split(' ')
S = [input() for i in range(N)]

ans = {}
for i in S:
  if i in ans:
    ans[i] += 1
  else:
    ans[i] = 1

max_value = max(ans.value())
ANS = []
for key, value in ans.item():
  if ans[key] == max_value:
    ANS.append(key)
    
for i in sorted(ANS):
  print(i)

### FIXED CODE ###

N = int(input())
S = [input() for i in range(N)]

ans = {}
for i in S:
  if i in ans:
    ans[i] += 1
  else:
    ans[i] = 1

max_value = max(ans.values())
ANS = []
for key, value in ans.items():
  if ans[key] == max_value:
    ANS.append(key)
    
for i in sorted(ANS):
  print(i)
#!/usr/bin/env python3
import sys

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()

    if a[m]>=t/(4*m):
        print("Yes")
    else:
        print("No")

main()



### FIXED CODE ###

#!/usr/bin/env python3
import sys

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()
    
    if a[m-1]>=t/(4*m):
        print("Yes")
    else:
        print("No")

main()
N=int(input())
S,T=map(input().split())
a=""
for i in range(N):
  a+=S[i]+T[i]
print(a)

### FIXED CODE ###

N=int(input())
S,T=map(str,input().split())
a=""
for i in range(N):
  a+=S[i]+T[i]
print(a)
a,b=map(int,input().split())
dic={3:1,2:2,1:3}
c=0
if a==1 and b==1:
	c+=dic[a]*10**5+dic[b]*10**5+4*10**5
    print(c)
    
else:
  if a in dic and b in dic:
    c+=dic[a]*10**5+dic[b]*10**5
    print(c)
   
  elif a in dic and b not in dic:
    c+=dic[a]*10**5
    print(c)
    
  elif a not in dic and b in dic:
    c+=dic[b]*10**5
    print(c)
   
    


### FIXED CODE ###

a,b=map(int,input().split())
dic={1:3*10**5,2:2*10**5,3:1*10**5}
c=0
if a in dic and b in dic:
    if a==1 and b==1:
        c+=dic[a]+dic[b]+4*10**5
        print(c)
    else:
        c+=dic[a]+dic[b]
        print(c)

elif a in dic and b not in dic:
    c+=dic[a]
    print(c)


elif b in dic and a not in dic:
    c+=dic[b]
    print(c)

else:
    print(c)
a,b=map(int,input().split())
import math
gcds=math.gcd(a,b)
cnt=0
primelist=[2]

while gcds%2==0:
    gcds=gcds//2
    cnt+=1
#この時点でgcdsは奇数になっているはずである
n = 10**6
prime = {i for i in range(2,n)}
for i in range(2,n):
    if i in prime:
        for j in range(i*2,n,i):
            if j in prime:
                prime.remove(j)
                #エラトステネスの篩
prime.remove(2)

for some in prime:
    if gcds%some==0:
        while gcds%some==0:
            gcds=int(gcds/some)
        primelist.append(some)  

if gcds!=1 and cnt>=1:
    primelist.append("larger")
    primelist.append(1)
    
elif gcds!=1 and cnt==0:
    primelist.append("larger")
    primelist.remove(2)
    primelist.append(1)
elif gcds==1 and cnt>=1:
    primelist.append(1)
elif gcds==1 and cnt==0:
    primelist.remove(2)
    primelist.append(1)

print(len(primelist))

### FIXED CODE ###

a,b=map(int,input().split())
import fractions
gcds=fractions.gcd(a,b)
cnt=0
primelist=[2]

while gcds%2==0:
    gcds=gcds//2
    cnt+=1
#この時点でgcdsは奇数になっているはずである
n = 10**6
prime = {i for i in range(2,n)}
for i in range(2,n):
    if i in prime:
        for j in range(i*2,n,i):
            if j in prime:
                prime.remove(j)
                #エラトステネスの篩
prime.remove(2)

for some in prime:
    if gcds%some==0:
        while gcds%some==0:
            gcds=int(gcds/some)
        primelist.append(some)  

if gcds!=1 and cnt>=1:
    primelist.append("larger")
    primelist.append(1)
    
elif gcds!=1 and cnt==0:
    primelist.append("larger")
    primelist.remove(2)
    primelist.append(1)
elif gcds==1 and cnt>=1:
    primelist.append(1)
elif gcds==1 and cnt==0:
    primelist.remove(2)
    primelist.append(1)

print(len(primelist))
import sys
n=int(input())
g=[[] for _ in range(n)]
for i in range(n-1):
  a,b=map(int,sys.stdin.readline().split())
  g[a-1].append([b-1,i])
  g[b-1].append([a-1,i])
l=[0]*(n-1)
def dfs(v,p=-1,c=-1):
  k=1
  for u,e in g[v]:
    if u==p: continue
    if k==c: k+=1
    l[e]=k
    k+=1
    dfs(u,v,l[e])
dfs(0)
print(max(len(g[v]) for v in range(n)))
for c in l: print(c)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
n=int(input())
g=[[] for _ in range(n)]
for i in range(n-1):
  a,b=map(int,sys.stdin.readline().split())
  g[a-1].append([b-1,i])
  g[b-1].append([a-1,i])
print(max(len(v) for v in g))
l=[0]*(n-1)
def dfs(v,p=-1,c=-1):
  k=1
  for u,e in g[v]:
    if u==p: continue
    if k==c: k+=1
    l[e]=k
    dfs(u,v,k)
    k+=1
dfs(0)
for c in l: print(c)
pair = [[1, 2], [2, 5], [3, 5], [4, 4], [5, 5], [6, 6], [7, 3], [8, 7], [9, 6]]
n, m = [int(x) for x in input().split()]
given = sorted([int(i) for i in input().split()])
given_pair = sorted([pair[x - 1] for x in given], reverse=True)

dp = (1 + n) * [0]
max_dp = 0
for i in range(n + 1):
    if i == 0:
        dp[i] = 0
    for j in range(m):
        if i - given_pair[j][1] >= 0:
            if dp[i - given_pair[j][1]] + 1 >= max_dp:
                max_dp = dp[i - given_pair[j][1]] + 1
    dp[i] = max_dp




def choice_list(x, index):
#    print("now_index", index)
#    print(given_pair[x][1])
#    print("now_dp_atai", dp[index - given_pair[x][1]])
    if dp[index - given_pair[x][1]] == dp[index] - 1:
        if dp[index - given_pair[x][1]] == 0:
            for j in given_pair:
                if index == j[1]:
                    return str(j[0])
            return ""
        else:
            return str(given_pair[x][0]) + choice_list(x, index - given_pair[x][1])

    else:
        return choice_list(x + 1, index)


print(choice_list(0, n))


### FIXED CODE ###

n, m = [int(i) for i in input().split()]
am = sorted([int(i) for i in input().split()],reverse=True)
c = [2, 5, 5, 4, 5, 6, 3, 7, 6]

dp = [-1 for i in range(n+1)]
dp[0]=0
for i in range(n+1):
    #max_tmp = -float("inf")
    for j in am:
        if i+c[j-1]<=n:
            dp[i+c[j-1]] = max(dp[i+c[j-1]], dp[i]+1)
#print(dp)
tmp_n = n
ans =""
for i in range(dp[n]):
    for j in range(m):
        if i==dp[n]-1 and tmp_n- c[am[j]-1] != 0:
            continue
        if tmp_n - c[am[j]-1] >= 0 and dp[tmp_n - c[am[j]-1]] == dp[tmp_n] -1:
            ans+=(str(am[j]))
            tmp_n -= c[am[j]-1]
            break


print(ans)
S=input()
for i in range(0,(len(S)),2):
    if S[i]=='R' or S[i]=='U' or S[i]=='D':
        for j in range (1,(len(S)),2):
            if S[j]=='L' or S[j]=='U' or S[j]=='D':
                mark=True
            else:
                mark=False
                break
    else:
        mark=False
        break
print('Yes' if mark==True else 'No')

### FIXED CODE ###

S=input()
print('No' if 'L' in S[0::2] or 'R' in S[1::2] else 'Yes')
A,B,C=map(str,input().split())
print(A[0].upper+B[0].upper+C[0].upper)


### FIXED CODE ###

A, B, C = input().split()
print(A[0].upper()+B[0].upper()+C[0].upper())
n,m,k = map(int,input().split())

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

s = 0
t = 0
for i in range(n+m):
    if a != []:
        if a[0] <= b[0]:
            c = a[0]
            a.pop(0)
        else:
            c = b[0]
            b.pop(0)
    else:
        c = b[0]
        b.pop(0)
    if s+c>k:
        break
    else:
        s += c
        t += 1
print(t) 

### FIXED CODE ###

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

A,B = [0],[0]

for i in range(n):
    A.append(A[i] + a[i])
for i in range(m):
    B.append(B[i] + b[i])

ans,j = 0,m

for i in range(n+1):
    if A[i] > k:
        break
    while B[j] > k - A[i]:
        j -= 1
    ans = max(ans,i+ j)
print(ans)
N = int(input())
A = [int(input()) for i in range(N)]

A.sort()
left = A[0]
right = A[N - 1]
ans = right - left
for i in range((N - 2) // 2):
    if i % 2 == 0:
        ans += right - A[1 + i]
        ans += A[N - 2 - i] - left
        right = A[1 + i]
        left = A[N - 2 - i]
    else:
        ans += left - A[1 + i]
        ans += A[N - 2 - i] - right
        left = A[1 + i]
        right = A[N - 2 - i]

if N % 2 == 1:
    ans += max(abs(right - A[N // 2]), abs(left - A[N // 2]))

print(ans)


### FIXED CODE ###

N = int(input())

for h in range((N + 3) // 4, 3501):
    for n in range((N + 3) // 4, 3501):
        a = N * h * n
        b = 4 * h * n - N * (h + n)
        if a > 0 and b > 0 and a % b == 0:
            print("{0} {1} {2}".format(h, n, a//b))
            exit()
def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0
    
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 3)]
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))


### FIXED CODE ###

import sys
import resource

def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0

sys.setrecursionlimit(10 ** 6)
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))
#print(countpar, par)
X, Y = map(int, input())
statement = False
for a in range(X+1):
  for b in range(X-a+1):
    c = X - a - b + 1
    if a * 10000 + b * 5000 + c * 1000 == Y:
      print(str(a) + " " + str(b) + " " + str(c))
      statement = True
      break
    if statement:
      break
if not statement:
  print("-1 -1 -1")

### FIXED CODE ###

X, Y = map(int, input().split())
statement = False
for a in range(X+1):
  for b in range(X-a+1):
    c = X - a - b
    if a * 10000 + b * 5000 + c * 1000 == Y:
      print(str(a) + " " + str(b) + " " + str(c))
      statement = True
      break
  if statement:
    break
if not statement:
  print("-1 -1 -1")
B = [False]*10005
C = [0]*10005
for i in range(2,10001):
    if not B[i]:
      	for j in range(i+i,10001,i):
          	B[j]=True
for i in range(3,10001,2):
    if not B[i] and not B[(i+1)//2]:
        C[i]+=1
for i in range(3,10001):
    C[i]=C[i]+C[i-1]
    
N = int(input())
for _ in range(N):
    a, b = map(int,input().split())
    print(C[b]-C[a])


### FIXED CODE ###

B = [False]*100005
C = [0]*100005
for i in range(2,100001):
    if not B[i]:
      	for j in range(i+i,100001,i):
          	B[j]=True
for i in range(3,100001,2):
    if not B[i] and not B[(i+1)//2]:
        C[i]+=1
for i in range(3,100001):
    C[i]=C[i]+C[i-1]
    
N = int(input())
for _ in range(N):
    a, b = map(int,input().split())
    print(C[b]-C[a-1])
#                         author:  kagemeka 
#                         created: 2019-11-07 02:35:07(JST)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator

def main():
    a, b, k = (int(i) for i in sys.stdin.readline().split())
    ab = list(range(a, b+1))
    if k * 2 >= len(ab):
        res = ab
    else:
        res = ab[:k] + ab[-k:]
    for r in res:
        print(r)


if __name__ == "__main__":
    # execute only if run as a script
    main()


### FIXED CODE ###

import sys

a, b, k = map(int, sys.stdin.readline().split())

def main():
    if k >= b - a + 1:
        res = list(range(a, b+1))
    else:
        res = set(range(a, a+k)) | set(range(b, b-k, -1))
        res = sorted(res)
    return res

if __name__ == '__main__':
    ans = main()
    print(*ans, sep='\n')
N = int(input())
Cap = [int(input()) for X in range(0,5)]
print(int(math.ceil(N/min(Cap))+4))

### FIXED CODE ###

import math
N = int(input())
Cap = [int(input()) for X in range(0,5)]
print(int(math.ceil(N/min(Cap))+4))
S = input()
cnt = 0
for i in len(S):
  if S[i] == 'A':
    cnt = cnt +1

if cnt == 3 or cnt == 0:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

S = input()
cnt = 0
for i in range(3):
  if S[i] == 'A':
    cnt = cnt +1
 
if cnt == 3 or cnt == 0:
  print('No')
else:
  print('Yes')
from itertools import permutations
import copy
def resolve():
    N, M = list(map(int, input().split()))
    G = [[0]*N for _ in range(M)]
    for i in range(M):
        a, b = list(map(int, input().split()))
        G[a-1][b-1] = 1
        G[b-1][a-1] = 1

    ls = list(permutations(range(1, N)))
    ans = 0
    for l in ls:
        h = copy.deepcopy(G)
        cnt = 1
        p = 0 
        for k in l:
            if h[p][k] == 0:
                break
            else:
                cnt += 1
                p = k
        if cnt == N:
            ans += 1
    print(ans)
    return
resolve()

### FIXED CODE ###

from itertools import permutations
import copy

def resolve():
    N, M = list(map(int, input().split()))
    G = [[0] * N for _ in range(N)]
    for i in range(M):
        a, b = list(map(int, input().split()))
        G[a-1][b-1] = 1
        G[b-1][a-1] = 1

    ls = list(permutations(range(1, N)))
    ans = 0
    for l in ls:
        h = copy.deepcopy(G)
        cnt = 1
        p = 0 
        for k in l:
            if h[p][k] == 0:
                break
            else:
                cnt += 1
                p = k
        if cnt == N:
            ans += 1
    print(ans)
    return

resolve()
D = int(input())
print("Cristmas "+" ".joined(["eve" for i in range(25-D)]))

### FIXED CODE ###

D = int(input())
print("Christmas "+" ".join(["Eve" for i in range(25-D)]))
n = int(input())
if n >= 30:
  print('Yes')
 else:
  print('No')

### FIXED CODE ###

n = int(input())
if n >= 30:
  print('Yes')
else:
  print('No')
n = int(input()):
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print("Yes")
            exit(0)
print("No")

### FIXED CODE ###

n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print("Yes")
            exit(0)
print("No")
import itertools
s=['S','H','C','D']
n=[i for i in range(1,14)]
c=[x y for x,y in itertools.product(s,n)]
for _ in range(input()):
 c.remove(input())
print(*c)

### FIXED CODE ###

n=int(input())
e=[input()for _ in[0]*n]
for s in"SHCD":
 for r in range(1,14):
  if f'{s} {r}'not in e:print(s,r)
# py abc163b.py
n,m = map(int,input().split())
val = sum(list(map(int,input().split())))
if val>m:
	print(-1)
else
	print(m-val)

### FIXED CODE ###

# py abc163b.py
n,m = map(int,input().split())
val = sum(list(map(int,input().split())))
if val>n:
	print(-1)
else:
	print(n-val)
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(input = sys.stdin.readline):
    # input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    #XLMIIS = lambda x : [LMIIS() for _ in range(x)]
    II = lambda : int(input())

    N = II()
    info = []
    MAXL = 101
    b = [[0] * MAXL for _ in range(MAXL)]

    def vtop(x1,x2,y1,y2,h1):
        ans = h1 + abs(x1-x2) + abs(y1-y2)
        return ans if ans <= 10**9 else 0

    # get info
    for i in range(N):
        x,y,h = LMIIS()
        info.append((x,y,h))

    # info = XLMIIS(N)
    if len(info) < N:
        raise Exception()
    elif len(info) > N:
        while True:
            pass

    # init candidates
    for x,y,h in info:
        if h != 0:
            for i in range(MAXL):
                for j in range(MAXL):
                    b[i][j] = vtop(x,j,y,i,h)
        break

    # check
    for x,y,h in info:
        for i in range(MAXL):
            for j in range(MAXL):
                if h == 0:
                    if b[i][j] > vtop(x,j,y,i,h):
                        b[i][j] = 0

                else:
                    if b[i][j] != vtop(x,j,y,i,h):
                        b[i][j] = 0

    # answer
    ansl = []
    for i in range(MAXL):
        for j in range(MAXL):
            if b[i][j] > 0:
                ansl.append((j,i,b[i][j]))
    
    ansl2 = []
    for x0,y0,h0 in ansl:
        f = True
        for x1,y1,h1 in info:
            
            if max(h0-abs(x0-x1)-abs(y0-y1),0) != h1:
                f = False
                break
        if f:
            ansl2.append((x0,y0,h0))
    x,y,h= ansl2[-1]
    print(x,y,h)


if __name__ == '__main__':
    main()

### FIXED CODE ###

#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(input = sys.stdin.readline):
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())

    N = II()
    info = []
    for _ in range(N):
        xi, yi, hi = LMIIS()
        if hi != 0:
            xt, yt, ht = xi, yi, hi
        info.append((xi, yi, hi))

    for Cy in range(101):
        for Cx in range(101):
            H = ht + abs(xt - Cx) + abs(yt - Cy)
            found = True
            for xi, yi, hi in info:
                tmp_h = max(H - abs(Cy-yi) - abs(Cx-xi), 0)
                if tmp_h != hi:
                    found = False
                    break
            if found:
                print('{} {} {}'.format(Cx,Cy,H))
                return



if __name__ == '__main__':
    main()