Harryxun/stf_run huggingface dataset:
x, n = map(int, input().split(' '))
min_num = 100

ls = [0] * 100
for i in range(0, 100):
    ls[i] = i+1

ls_in = [0] * n
if n > 0:
    ls_in = list(map(int, input().split(' ')))
    for i in ls_in:
        ls.remove(i)
    ls.reverse()
    for i in ls:
        min_num = min(abs(x-i), min_num)
        if abs(x-i) == min_num:
            ans = i 
    print(ans)
else:
    print(x)

### FIXED CODE ###

x, n = map(int, input().split(' '))
min_num = 100

ls = [0] * 201
for i in range(0, 201):
    ls[i] = i

ls_in = [0] * n
if n > 0:
    ls_in = list(map(int, input().split(' ')))
    for i in ls_in:
        ls.remove(i)
    ls.reverse()
    for i in ls:
        min_num = min(abs(x-i), min_num)
        if abs(x-i) == min_num:
            ans = i 
    print(ans)
else:
    print(x)
S = int(input())

W = int(input())

if W >= S:
  print("unsafe")
else:
  print("safe")

### FIXED CODE ###

s, w = map(int, input().split())

if w >= s:
  print("unsafe")
  
else:
  print("safe")
from collections import defaultdict
from heapq import heappush, heappop

def dijkstra(graph:list, node:int, start:int) -> list:
    # graph[node] = [(cost, to)]
    inf = float('inf')
    dist = [inf] * node

    dist[start] = 0
    heap = [(0, start)]
    while heap:
        cost, thisNode = heappop(heap)
        for NextCost, NextNode in graph[thisNode]:
            dist_cand = dist[thisNode] + NextCost
            if dist_cand < dist[NextNode]:
                dist[NextNode] = dist_cand
                heappush(heap,(dist[NextNode], NextNode))
    return dist
    # dist = [costs to nodes]


n, m = map(int, input().split())
graph = defaultdict(list)
edges = []
l_nodes = set()
r_nodes = set()
for i in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    edges.append((l, r, d))
    graph[l].append((d, r))
    l_nodes.add(l)
    r_nodes.add(r)

if m == 0:
    print("Yes")
else:
    x = l_nodes - r_nodes

    dist = dijkstra(graph, n, list(x)[0])
    possible = True
    for l, r, d in edges:
        if d != abs(dist[l] - dist[r]):
            possible = False
            break

    if possible:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

from collections import deque

def topological_sort(graph: list, n_v: int) -> list:
    # graph[node] = [(cost, to)]
    indegree = [0] * n_v # 各頂点の入次数
    for i in range(n_v):
        for c, v in graph[i]:
            indegree[v] += 1

    cand = deque([i for i in range(n_v) if indegree[i] == 0])
    res = []
    while cand:
        v1 = cand.popleft()
        res.append(v1)
        for c, v2 in graph[v1]:
            indegree[v2] -= 1
            if indegree[v2] == 0:
                cand.append(v2)

    return res




n, m = map(int, input().split())
edges = [[] for _ in range(n)]
for i in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    edges[l].append((d, r))

ts = topological_sort(edges, n)

if len(ts) != n:
    ans = "No"
    # print("Not DAG")
else:
    # DAG
    dist = [-1] * n
    ans = "Yes"
    for i in range(n):
        v = ts[i]
        if dist[v] == -1:
            dist[v] = 0

        for c, u in edges[v]:
            if dist[u] == -1:
                dist[u] = dist[v] + c
            elif dist[u] != dist[v] + c:
                ans = "No"
                break

print(ans)
#abc103 b
s=input()
t=input()
flag=False
for i in range(n):
    new_t=t[-1]
    new_t+=t[:-1]
    if new_t==s:
        flag=True
        break
    t=new_t

print("Yes" if flag else "No" )

### FIXED CODE ###

#abc 103 b
s=input()
t=input()
flag=False
for i in range(-1,-len(s)-1,-1):
    new_t=""
    for j in range(len(s)):
        new_t+=t[i+j]
    #print(i,s,new_t)
    if new_t==s:
        flag=True
        break
if flag:
    print("Yes")
else:
    print("No")
A,B,C,D = map(int,input().split())

import math

def num(N,c,d):
    lcm = (c*d)//math.gcd(c,d)
    return N - (N//c) - (N//d) +  N//lcm

print(num(B,C,D)-num(A-1,C,D))


### FIXED CODE ###

A,B,C,D = map(int,input().split())

def gcd(a,b):
    if a%b == 0:
        return b
    else:
        return gcd(b,a%b)

def num(N,c,d):
    lcm = (c*d)//gcd(c,d)
    return N - (N//c) - (N//d) +  N//lcm

print(num(B,C,D)-num(A-1,C,D))
# -*- coding: utf-8 -*-
import sys
from bisect import bisect_left, bisect_right
import itertools

A,B,Q=map(int, sys.stdin.readline().split())

S=[  int(sys.stdin.readline()) for i in range(A) ]
T=[  int(sys.stdin.readline()) for i in range(B) ]
X=[  int(sys.stdin.readline()) for i in range(Q) ]


for x in X:
	sx=bisect_left(S, x)
	tx=bisect_left(T, x)

	s_temp=[]
	if sx==0:
		s_temp.append(S[sx])	
	elif 0<sx<A:
		s_temp.append(S[sx-1])
		s_temp.append(S[sx])
	else:
		s_temp.append(S[sx-1] )


	t_temp=[]
	if tx==0:
		t_temp.append(T[tx])	
	elif 0<tx<A:
		t_temp.append(T[tx-1])
		t_temp.append(T[tx])
	else:
		t_temp.append(T[tx-1] )


	ans=float("inf")

	for s in s_temp:
		for t in t_temp:
			ans=min(ans, abs(s-x)+abs(s-t) )

	for t in t_temp:
		for s in s_temp:	
			ans=min(ans, abs(t-x)+abs(s-t) )

	print ans
		

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from bisect import bisect_left, bisect_right
import itertools

A,B,Q=map(int, sys.stdin.readline().split())

S=[  int(sys.stdin.readline()) for i in range(A) ]
T=[  int(sys.stdin.readline()) for i in range(B) ]
X=[  int(sys.stdin.readline()) for i in range(Q) ]


for x in X:
	sx=bisect_left(S, x)
	tx=bisect_left(T, x)

	s_temp=[]
	if sx==0:
		s_temp.append(S[sx])	
	elif 0<sx<A:
		s_temp.append(S[sx-1])
		s_temp.append(S[sx])
	else:
		s_temp.append(S[sx-1] )


	t_temp=[]
	if tx==0:
		t_temp.append(T[tx])	
	elif 0<tx<B:
		t_temp.append(T[tx-1])
		t_temp.append(T[tx])
	else:
		t_temp.append(T[tx-1] )


	ans=float("inf")

	for s in s_temp:
		for t in t_temp:
			ans=min(ans, abs(s-x)+abs(s-t) )

	for t in t_temp:
		for s in s_temp:	
			ans=min(ans, abs(t-x)+abs(s-t) )

	print ans
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))
S =sum(A)
cut = []
for k in range(N):
  cut.append(K*A[k]//S + 1)

length = []
after = []
for k in range(N):
  length.append(A[k] / (cut[k]+1))
  after.append([A[k] / cut[k], k])
after.sort(key = lambda x: x[0])

def nibun_insert(lis, item):
  end = len(lis)
  start = 0
  now = (end+start)//2
  while end > start+1:
    if lis[now][0] < item[0]:
      start = 0 + now
      now = (now + end)//2
    else:
      end = 0 + now
      now = (now + start)//2
  return lis[:now+1] + [item] + lis[now+1:]
  

C = sum(cut)
res = C - K
after = after[:res+1]
for _ in range(res):
  while cut[after[0][1]] == 0:
    after = after[1:]
  cut[after[0][1]] -= 1
  length[after[0][1]] = 0 + after[0][0]
  after[0][0] *= (cut[after[0][1]]+2)/(cut[after[0][1]]+1)
  if after[0][0] > after[1][0]:
    after = nibun_insert(after[1:], after[0])

length.sort()  
print(math.ceil(length[-1]))


### FIXED CODE ###

import math
from collections import deque
N, K = map(int, input().split())
A = list(map(int, input().split()))
S =sum(A)
cut = []
for k in range(N):
  cut.append(K*A[k]//S)

length = []
for k in range(N):
  length.append([A[k] / (cut[k]+1), k])

length.sort(key = lambda x: x[0], reverse=True)

def nibun_insert(lis, item):
  end = len(lis)
  start = 0
  now = (end+start)//2
  while end > start+1:
    if lis[now][0] > item[0]:
      start = 0 + now
      now = (now + end)//2
    else:
      end = 0 + now
      now = (now + start)//2
  return deque(lis[:now+1] + [item] + lis[now+1:])
  

C = sum(cut)
res = min(K - C, N)
length = length[:res+1]
length = deque(length)
for k in range(res):
  a = length.popleft()
  cut[a[1]] += 1
  a[0] = a[0]*cut[a[1]]/(cut[a[1]]+1)
  if a[0] <= length[-1][0]:
    length.append(a)
  elif a[0] >= length[0][0]:
    length.appendleft(a)
  else:
    length = nibun_insert(list(length), list(a))
  length.pop()

print(math.ceil(length.popleft()[0]))
s = input()
wl = [chr(i) for i in range(97,123)]
hoge = 'zyxwvutsrqponmlkjihgfedcba'
if s == hoge:
  print(-1)
  exit()
if len(s) < 26:
  for w in wl:
    if not w in s:
      s += w
      print(s)
      exit()
else:
  for i in range(26):
    for j in range(ord(s[-i-1])+1, 97+26):
      if chr(j) not in s[:-i-1]:
        print(S[:-i-1] + chr(j))

### FIXED CODE ###

s = input()
k = 'abcdefghijklmnopqrstuvwxyz'
if len(s) < 26:
  for v in k:
    if not v in s:
      print(s+v)
      exit()
if s == k[::-1]:
  print(-1)
  exit()
for i in range(1,len(s)+1):
  t = s[-i:]
  if t != ''.join(sorted(t, reverse=True)):
    t = t[1:]
    break
for p in t[::-1]:
  if p > s[-i]:
    print(s[:-i]+p)
    exit()
n = int(input())
if n == 1:
	print(0)
else:
	vals = list(map(int, input().split()))
    costs = list(map(int, input().split()))

	total = 0
	for v, c in zip(vals, costs):
    	resale = v - c
        if resale > 0:
        	total += resale


### FIXED CODE ###

n = int(input())
vals = list(map(int, input().split()))
costs = list(map(int, input().split()))

if n == 1:
    print(0)
else:
    total = 0
    for v, c in zip(vals, costs):
        resale = v - c
        if resale > 0:
            total += resale
    print(total)
n = int(input())
a = sorted(set(list(map(int, input().split()))))[::-1]
Length = 0
for i in range(n-2):
    Length += a[i]-a[i+1]
print(Length)

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int,input().split())))
print(a[n-1]-a[0])
def main():
    n, q = map(int, input().split())
    t = [[] for _ in range(n)]
    for _ in range(n-1):
        a, b = map(lambda x: int(x)-1, input().split())
        t[a].append(b); t[b].append(a)
    c = [0]*n
    for i in range(q):
        p, x = map(int, input().split())
        p -= 1
        c[p] += x

    def dfs(node, p=-1):
        for child in t[node]:
            if child==p:
                continue
            c[child] += c[node]
            dfs(child, node)
    dfs(0)
    print(*c)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

n, q = map(int, input().split())
g = [list() for i in range(n)]
node = [0] * n

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

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

def dfs(v, p=-1):
    for u in g[v]:
        if u == p: continue
        node[u] += node[v]
        dfs(u, v)

dfs(0)
print(*node)
a=list(int(input()))
a.sort()
print(a[0]+a[1])

### FIXED CODE ###

a=list(map(int,input().split()))
a.sort()
print(a[0]+a[1])
n = int(input)
count = 0
ans = 'No'
for _ in range(n):
	a,b = map(int,input().split(' ')
    if a!=b:
    	count = 0 
    else:
    	count+=1
    if count ==3:
    	ans = 'Yes'
print(ans)        


### FIXED CODE ###

n = int(input())
count = 0
ans = 'No'
for i in range(n):
    a , b = map(int,input().split(' '))
    if a!=b:
        count = 0 
    else:
        count += 1
    if count == 3:
        ans = 'Yes'
print(ans)
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
    for s in [-1, +1]:
            a = X + s * d
if p.count(a) == 0:
print(a)
exit(0)


### FIXED CODE ###

X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
    for s in [-1, +1]:
        
        a = X + s * d
        if p.count(a) == 0:
            print(a)
            exit(0)
s = input()
ACGT = ["A","C","G","T"]
ans = 0
ANS = []

for i in range(len(s)):
    if s[i] in ACGT:
        ans += 1
    else:
        ANS.append(ans)
        ans = 0
        
print(max(ANS))

### FIXED CODE ###

s = input()
ACGT = ["A","C","G","T"]
ans = 0
ANS = [0]

for i in range(len(s)):
    if s[i] in ACGT:
        ans += 1
    else:
        ans = 0
        
    ANS.append(ans)
        
print(max(ANS))
a, b = map(int, input())

print(a + (b / 2))

### FIXED CODE ###

a, b = map(int, input().split())
 
print(round(a + (b / 2)))
a,b,c = map(int, input().split()

S = c - a + b
if S > 0 :
            print (S)
else :
            print ("0")

### FIXED CODE ###

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

S = c - a + b
if S > 0 :
            print (S)
else :
            print ("0")
import sys
sys.setrecursionlimit(10**9)

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

Map = [[] for _ in range(M)]
reached = [False]*N

for _ in range(M):
    aa, bb = map(int, input().split())
    Map[aa-1].append(bb-1)
    Map[bb-1].append(aa-1)

cnt = 0

def DFS(x):
    global cnt
    reached[x] = True

    if all(reached):
        cnt += 1

    for i in range(N):
        if reached[i]:
            continue

        if i in Map[x]:
            DFS(i)

    reached[x] = False
    return

DFS(0)
print(cnt)


### FIXED CODE ###

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

Map = [[] for _ in range(N)]
reached = [False]*N

for _ in range(M):
    aa, bb = map(int, input().split())
    Map[aa-1].append(bb-1)
    Map[bb-1].append(aa-1)

cnt = 0

def DFS(x):
    global cnt
    global reached

    reached[x] = True

    if all(reached):
        cnt += 1
        reached[x] = False

        return

    for i in Map[x]:
        if reached[i]:
            continue

        else:
            DFS(i)

    reached[x] = False


DFS(0)
print(cnt)
n = int(input())
sum =0
for j in range(n):
  i,c = input().split()
  if c =="JPY":
    sum+=i
  else:
    sum+=i*380000
print(sum)

### FIXED CODE ###

n = int(input())
sum =0
for j in range(n):
  i,c = input().split()
  if c =="BTC":
    sum+=float(i)*380000
  else:
    sum+=int(i)
print(sum)
N, M = map(int, input().split())
adjacent = []
score = ['None' for i in range(N)]
score[0] = 0
for i in range(M):
    a, b, c = map(int, input().split())
    adjacent.append([a-1, b-1, c])
for i in range(2N):
    for j in adjacent:
      if score[j[1]] == 'None' and score[j[0]] != 'None':
        score[j[1]] = score[j[0]] + j[2]
      if score[j[1]] != 'None' and score[j[0]] != 'None':
        if score[j[1]] < score[j[0]] + j[2]:
          score[j[1]] = score[j[0]] + j[2]
    if i == N-1:
      t = score[N-1]
    if i == 2N:
      if t != score[N-1]:
        score[N-1] = 1e+15
if score[N-1] < 1e+15:
    print(score[N-1])
else:
    print('inf')


### FIXED CODE ###

N, M = map(int, input().split())
adjacent = []
score = ['None' for i in range(N)]
score[0] = 0
for i in range(M):
    a, b, c = map(int, input().split())
    adjacent.append([a-1, b-1, c])
for i in range(N):
    for j in adjacent:
      if score[j[1]] == 'None' and score[j[0]] != 'None':
        score[j[1]] = score[j[0]] + j[2]
      if score[j[1]] != 'None' and score[j[0]] != 'None':
        if score[j[1]] < score[j[0]] + j[2]:
          score[j[1]] = score[j[0]] + j[2]
    if i == N-2:
      t = score[N-1]
    if i == N-1:
      if t != score[N-1]:
        score[N-1] = 1e+15
if score[N-1] < 1e+15:
    print(t)
else:
    print('inf')
n = int(input())
x = [int(i) for i in input().split()]
d = []
for i in range(min(x), max(x)):
  a = 0
  for j in x:
    a += (j - i)**2
#    print("({}-{})**2={}".format(j,i,(j - i)**2))
  d.append(a)
print(min(d))


### FIXED CODE ###

n = int(input())
x = [int(i) for i in input().split()]
d = []
for i in range(min(x), max(x)+1):
  a = 0
  for j in x:
    a += (j - i)**2
#    print("({}-{})**2={}".format(j,i,(j - i)**2))
  d.append(a)
print(min(d))
N = int(input())

odd = 0
even = 0
for i in range(N-1):
	if i % 2 == 0:
		odd += 1
	else:
		even += 1

total = odd + even
print(odd/total)

### FIXED CODE ###

N = int(input())

odd = 0
even = 0
for i in range(N):
	if i % 2 == 0:
		odd += 1
	else:
		even += 1

print(odd/(odd + even))
n, m = map(int, input().split())
ans = 0
b = []
while m != 0:
    l, r = map(int, input().split())
    if not b:
        for a in range(1, n + 1):
            c = a
            print(b)
            while True:
                if a >= l:
                    if a <= r:
                        b.append(c)
                        break
                    else:
                        break
                else:
                    break
    elif m != 1:
        for a in b:
            print(b)
            c = a
            while True:
                if a >= l:
                    if a <= r:
                        ans += 1
                        break
                    else:
                        b.remove(c)
                        break
                else:
                    b.remove(c)
                    break
    else:
        for a in b:
            print(b)
            c = a
            while True:
                if a == n:
                    ans += 1
                    break
                if a >= l:
                    if a <= r:
                        a += 1
                    else:
                        break
                else:
                    break
    m -= 1

print(ans)

### FIXED CODE ###

a, b = map(int, input().split())
if a <= 5:
    ans = 0
elif a <= 12:
    ans = b // 2
else:
    ans = b
print(ans)
n,m = map(int,input().split())
l = [int(input()) for _ in range(m)]
q = 10**9+7

def a(x):
  memo = [0]*(x)
  if x in l :
    return 0
  if x==1:
    return 1
  elif x==2:
    return 2
  else:
    if memo[x-1]!=0:
      return memo[x-1]
    else:
      memo[x-1] = a(x-1)+a(x-2)
      return (a(x-1)+a(x-2))%q
print(a(n)%q)

### FIXED CODE ###

n,m = map(int,input().split())
l = [int(input()) for _ in range(m)]
q = 10**9+7
memo = [-1]*(n+1)
memo[0]=1
su = 0
if 1 in l:
  memo[1]=0
else:
  memo[1]=1
for j in l:
  memo[j]=0
  
for i in range(2,n+1):
  if memo[i]==0:
    continue
  else:
    memo[i]=((memo[i-1]%q)+(memo[i-2]%q))%q
print(memo[-1]%q)
from sys import stdin
from collections import defaultdict

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = []
L = [int(x) for x in stdin.readline().rstrip().split()]

D = 0
i = 0
while(D<=X and i<N+1):
    i += 1
    D += L[i-1]

print(i)


### FIXED CODE ###

#not accept

from sys import stdin
from collections import defaultdict

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = []
L = [int(x) for x in stdin.readline().rstrip().split()]

D = [0]
for i in range(1,N+1):
    D.append(D[i-1] + L[i-1])

max = 0
for i in range(1,N+1):
    if D[i] <= X:
      max = i
    else:
      break

print(max+1)
import sys

N = int(input())
xs = []
ys = []
hs = []
for i in range(N):
    x, y, h = map(int, input().split())
    if h > 0:
        xs.append(x)
        ys.append(y)
        hs.append(h)

for cx in range(0, 100+1):
    for cy in range(0, 100+1):
        Hs = set()
        for i in range(N):
            calcH = max(abs(xs[i]-cx) + abs(ys[i]-cy) + hs[i], 0)
            Hs.add(calcH)
        if len(Hs) == 1:
            print(cx, cy, Hs.pop())
            sys.exit(0)


### FIXED CODE ###

import sys

# 解説カンニング済み

N = int(input())
xs = []
ys = []
hs = []
reference = None
for i in range(N):
    x, y, h = map(int, input().split())
    xs.append(x)
    ys.append(y)
    hs.append(h)
    # 地面でないことが分かっている(ピラミッド内のサンプル)を1つ選ぶ
    if h > 0:
        reference = (x, y, h)

for cx in range(0, 100+1):
    for cy in range(0, 100+1):
        # サンプルの高さを求める
        rx, ry, rh = reference
        ref_H = rh + abs(rx-cx) + abs(ry-cy)
        # 他のデータも全てサンプルと合致するか検証する
        ok = True
        for i in range(N):
            calc_H = max(ref_H - abs(xs[i]-cx) - abs(ys[i]-cy), 0)
            if calc_H != hs[i]:
                ok = False
                break
        if ok:
            print(cx, cy, ref_H)
            sys.exit(0)
def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
def b(k,i):
  if(i==k-1):
    return 1
  else:
    return combi(k-1,i)

def r(n,k,i):
  if(n-k-1<=0):
    return 1
  else:
    return combi(n-k+1,i+1)
  
def main():
  n,k = map(int,input().split())	
  
  for i in range(k):
    ans=b(k,i)*r(n,k,i)%(1000000000+7)
    print(ans)
  

import sys
input = sys.stdin.readline
import math  
main()

### FIXED CODE ###

from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return [list(map(int, input().split())) for _ in range(n)]

def main():
    n,k = map(int,input().split())
    dp = [[0 for _ in range(k+1)] for _ in range(k+1)]
    dp[0][0] = 1
    for i in range(1,k+1):
        for j in range(1,i+1):
            dp[i][j] = (dp[i-1][j]*(i+j-1)+dp[i-1][j-1]*(n-k-j+2))//i
    for i in range(1,k+1):
        print(dp[-1][i]%mod)

if __name__ == "__main__":
    main()
#python3

graph = [[-1 for _ in range(15)] for _ in range(15)]

def main():
    n = int(input())
    for i in range(n):
        a = int(input())
        for j in range(a):
            x, y = map(int, input().split())
            graph[i][x-1] = y
            
    ans = 0
    for i in range(1<<15):
        h = [0]*15
        for k in range(n):
            if (i >> k) & 1:
                h[k] = 1

        f = True
        for i in range(15):
            if h[i] == 1:
                for j in range(n):
                    if graph[i][j] == -1:
                        continue
                    if graph[i][j] != h[j]:
                        f = False

        if f:
            ans = max(ans, sum(h))

    print(ans)
main()

### FIXED CODE ###

#python3
import numpy as np
N = int(input())
A = np.array([int(_) for _ in input().split()])
mod = 10**9 + 7
ans = 0
for b in range(60):
    B = (A >> b) & 1
    M = np.count_nonzero(B)
    ans += 2**b * M * (N - M)
    ans %= mod
print(ans)
import math
x,y = int(input())

m = (x+y)/2

print(math.ceil(m))

### FIXED CODE ###

import math
x,y = map(int,input().split())
 
m = (x+y)/2
 
print(math.ceil(m))
n, m = map(int, input().split())

c = [0]* m
s = [0]* m
for i in range(m):
    s[i], c[i] = map(int, input().split())

flg = True

if n == 1:
    i_str = str(0)
    for j in range(m):
        if i_str[s[j]-1] != str(c[j]):
            flg = False
            continue
    if flg==True:
        print(i)
        exit()
    flg = True

for i in range(10**(n-1),10**n):
    i_str = str(i)
    for j in range(m):
        if i_str[s[j]-1] != str(c[j]):
            flg = False
            continue
    if flg==True:
        print(i)
        exit()
    flg = True

print(-1)


### FIXED CODE ###

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

c = [0]* m
s = [0]* m
for i in range(m):
    s[i], c[i] = map(int, input().split())

flg = True

if n == 1:
    i = 0
    i_str = str(i)
    for j in range(m):
        if i_str[s[j]-1] != str(c[j]):
            flg = False
            continue
    if flg==True:
        print(i)
        exit()
    flg = True

for i in range(10**(n-1),10**n):
    i_str = str(i)
    for j in range(m):
        if i_str[s[j]-1] != str(c[j]):
            flg = False
            continue
    if flg==True:
        print(i)
        exit()
    flg = True

print(-1)
a, b, c = map(int, input().split())
    print(a + b + c - max(a, b, c))

### FIXED CODE ###

a, b, c = map(int, input().split())
print(a + b + c - max(a, b, c))
import math

    h, n = map(int, input().split())
    a = map(int, input().split())
    if h - sum(a) > 0:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###

import math
 
h, n = map(int, input().split())
a = map(int, input().split())
if h - sum(a) > 0:
    print("No")
else:
    print("Yes")
n,k=map(int,input().split())
s=input()
s[k-1]=s[k-1].lower()

print(s)

### FIXED CODE ###

n,k=map(int,input().split())
s=input()
print(s[:k-1]+str.lower(s[k-1])+s[k:])
x = input().split(" ")
w = int(x[0])
h = int(x[1])
x = int(x[2])
y = int(x[3])
r = int(x[4])
if x - r < 0:
    print("No")
elif w < x + r:
    print("No")
elif y - r < 0:
    print("No")
elif h < y + r:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

line = input().split(" ")
w = int(line[0])
h = int(line[1])
x = int(line[2])
y = int(line[3])
r = int(line[4])
if x - r < 0:
    print("No")
elif w < x + r:
    print("No")
elif y - r < 0:
    print("No")
elif h < y + r:
    print("No")
else:
    print("Yes")