Harryxun/stf_run huggingface dataset:
H, W, A, B = map(int, input().split())
answer = 0
mod = 1000000007
factorial = [1]
for n in range(1, H+W):
    factorial.append(factorial[n-1]*n%mod)
def power(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x % mod
    elif y % 2 == 0:
        return power(x, y/2)**2%mod
    else:
        return power(x, y/2)**2*x%mod

inverseFactorial = [0] * (H+W)
inverseFactorial[H+W-1] = power(factorial[H+W-1], mod-2)
for n in range(H+W-2, -1, -1):
    inverseFactorial[n] = inverseFactorial[n+1] * (n+1) % mod
def combi(n, m):
    return factorial[n] * inverseFactorial[m] *inverseFactorial[n-m]%mod

for i in range(B+1, W+1):
    answer = (answer + combi(H-A-2+i, i-1)*combi(A+W-i-1,W-i)) % mod
print(answer)

### FIXED CODE ###

H, W, A, B = map(int, input().split())
answer = 0
mod = 1000000007
factorial = [1]
for n in range(1, H+W):
    factorial.append(factorial[n-1]*n%mod)
def power(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x % mod
    elif y % 2 == 0:
        return power(x, y//2) ** 2 % mod
    else:
        a = power(x, y//2) ** 2
        return a * x % mod
inverseFactorial = [0] * (H+W)
inverseFactorial[H+W-1] = power(factorial[H+W-1], mod-2)
for n in range(H+W-2, -1, -1):
    inverseFactorial[n] = inverseFactorial[n+1] * (n+1) % mod
def combi(n, m):
    return factorial[n] * inverseFactorial[m] *inverseFactorial[n-m]%mod

for i in range(B+1, W+1):
    answer = (answer + combi(H-A-2+i, i-1)*combi(A+W-i-1,W-i)) % mod
print(answer)
from collections import Counter


def solve(n, arr):
    if arr[0] != 0:
        return 0

    c = Counter(arr)
    c.sort()

    if len(c) != max(c.keys()) + 1:
        return 0

    c = list(c.values())

    prev = c[0]
    ans = 1
    mod = 998244353

    for i in c[1:]:
        ans *= pow(prev, i) % mod
        ans %= mod
        prev = i

    return ans


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

print(solve(n, arr))

### FIXED CODE ###

from collections import Counter


def solve(n, arr):
    if arr[0] != 0:
        return 0

    c = Counter(arr)

    if c[0] != 1:
        return 0
    max_c = max(c)
    for i in range(max_c + 1):
        if i not in c:
            return 0

    c = list(c.items())
    c.sort()

    prev = 1
    ans = 1
    mod = 998244353

    for _, i in c[1:]:
        ans *= pow(prev, i) % mod
        ans %= mod
        prev = i

    return ans


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

print(solve(n, arr))
N,M = map(int,input().split())

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.stack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))

### FIXED CODE ###

import numpy as np
N,M = map(int,input().split())

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.vstack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))
import math

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

c_4=0
c_2=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    c_2+=1


if c_2==1:
  num=n
else:
  num=n-c_2  
  
if matj.ceil(num/2) <= c_4:
  ans="Yes"
elif c_2==n:
  ans="Yes"
else:
  ans="No"
  
print(ans)

### FIXED CODE ###

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

c_4=0
even=0
odd=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    even+=1
  else:
    odd+=1
  
if even==0 and odd-1 <= c_4:
  ans="Yes"
else:
  ans="No"
  
if even>0 and odd <= c_4:
  ans="Yes"
else:
  "No"

print(ans)
N,M = map(int,input(),split())
print("Yes" if N == M else "No")

### FIXED CODE ###

N,M = map(int,input().split())
print("Yes" if N == M else "No")
N = int(input())
T_arr = []
for _ in range(N):
    T_arr.append(int(input()))
    




import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(T_arr))

### FIXED CODE ###

N = int(input())
T_arr = []
for _ in range(N):
    T_arr.append(int(input()))
    

import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(T_arr))
n=input()
print('Yes' if n%9==0 else 'No')

### FIXED CODE ###

n=input()
num=0
for i in n:
  num+=int(i)

print('Yes' if num%9==0 else 'No')
s = input()
SENT = ('A','T','G','C')

ans = 0
count = 0
for c in s:
  if c in SENT:
    count += 1
  else:
    ans = max(ans,conut)
    count = 0
else:
  ans = max(ans,count)
  
print(ans)

### FIXED CODE ###

S = input()
atgc = ['A','T','G','C']
flag = True
count = 0
max = 0

for c in S:
  if (c in atgc):
    flag = True
    if not flag:
      count = 0
    count += 1
    if max < count:
      max = count
  else:
    flag = False
    count = 0
    
print(max)
N, Y = int(input().split())
ans = [-1,-1,-1]
for x in range(N+1):
  for y in range(N+1):
    z = N - x - y
    if 10000 * x + 5000 * y + 1000 * z == Y:
      ans[0] = x
      ans[1] = y
      ans[2] = z
print(ans[0],ans[1],ans[2])

### FIXED CODE ###

N, Y = map(int, input().split())
 
ans = [-1,-1,-1]
for x in range(0,N+1):
    for y in range(0,N-x+1):
        z = N - x - y
        if x*10000 + y*5000 + z*1000 == Y:
            ans[0] = x
            ans[1] = y
            ans[2] = z
print(ans[0],ans[1],ans[2])
h,w = map(int,input().split())

al_l = []

for _ in range(h):
    al = list(map(int,input().split()))
    al_l.append(al)
    
ansl = []
get = False
for i in range(h):
    for j in range(w-1):
        if not get:
            if al_l[i][j] % 2 == 1:
                get = True
                al_l[i][j] -= 1
                al_l[i][j+1] += 1
                ansl.append(str(i+1)+" "+str(j+1)+" "+str(i+1)+" "+str(j+2))
        elif get:
            if al_l[i][j] % 2 == 0:
                get = False
            else:
                al_l[i][j] -= 1
                al_l[i][j+1] += 1
                ansl.append(str(i+1)+" "+str(j+1)+" "+str(i+1)+" "+str(j+2))
            
get = False  
for i in range(h-1):
    if not get:
        if al_l[i][-1] % 2 == 1:
            get = True
            al_l[i][-1] -= 1
            al_l[i+1][-1] += 1
            ansl.append(str(i+1)+" "+str(j+1)+" "+str(i+2)+" "+str(j+1))
    elif get:
        if al_l[i][-1] % 2 == 0:
            get = False
        else:
            al_l[i][-1] -= 1
            al_l[i+1][-1] += 1
            ansl.append(str(i+1)+" "+str(j+1)+" "+str(i+2)+" "+str(j+1))

print(len(ansl))
for ans in ansl:
    print(ans)
        



### FIXED CODE ###

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

al_l = []

for _ in range(h):
    al = list(map(int,input().split()))
    al_l.append(al)
    
ansl = []
get = False
for i in range(h):
    for j in range(w-1):
        if not get:
            if al_l[i][j] % 2 == 1:
                get = True
                al_l[i][j] -= 1
                al_l[i][j+1] += 1
                ansl.append(str(i+1)+" "+str(j+1)+" "+str(i+1)+" "+str(j+2))
        elif get:
            if al_l[i][j] % 2 == 0:
                get = False
            else:
                al_l[i][j] -= 1
                al_l[i][j+1] += 1
                ansl.append(str(i+1)+" "+str(j+1)+" "+str(i+1)+" "+str(j+2))
            
get = False  
for i in range(h-1):
    if not get:
        if al_l[i][-1] % 2 == 1:
            get = True
            al_l[i][-1] -= 1
            al_l[i+1][-1] += 1
            ansl.append(str(i+1)+" "+str(w)+" "+str(i+2)+" "+str(w))
    elif get:
        if al_l[i][-1] % 2 == 0:
            get = False
        else:
            al_l[i][-1] -= 1
            al_l[i+1][-1] += 1
            ansl.append(str(i+1)+" "+str(w)+" "+str(i+2)+" "+str(w))

print(len(ansl))
for ans in ansl:
    print(ans)
l=list(map(int,input().split()))
u=max(l)
d=0
i=0
while l[i]!=u:
  if l[i]>l[i+1]:
    d=d+abs(l[i+1]-l[i])
  i=i+1
r=i
else:
  for b in range(r,len(l)):
    d=d+(u-l[b])
print(d)


### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
u=max(l)
d=0
i=0
while l[i]!=u:
  if l[i]>l[i+1]:
    d=d+abs(l[i+1]-l[i])
    l[i+1]=l[i] 
  i=i+1
r=i
for b in range(r,n):
    d=d+(u-l[b])
print(d)
N = int(input())
H = list(map(int, input().split()))
max_count = 0
for i in range(N-1):
  tmp_count = 0
  for j in range(i, N-1):
  	if H[j] >= H[j+1]:
      tmp_count=tmp_count+1
  

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
tmp = 0
s = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    tmp += 1
    s = max(s, tmp)
  else:
    tmp = 0
    
print(s)
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

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

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,K,C = LI()
S = str(input())

dp = [0]*N
for i in range(N)[::-1]:
    if S[i]=='o':
        if i+C+1 >= N:
            dp[i] = 1
        else:
            dp[i] = max(dp[i+C+1]+1,dp[i+1])
    else:
        dp[i] = dp[i+1]

dpz = [0]*N
for i in range(N):
    if S[i]=='o':
        if i-C-1 < 0:
            dpz[i] = 1
        else:
            dpz[i] = max(dpz[i-C-1]+1,dpz[i-1])
    else:
        dpz[i] = dpz[i-1]

ans = []
if dp[1] < K:
    ans.append(1)

for i in range(1,N-1):
    if dp[i]+dpz[i]-1 >= K and dp[i+1]+dpz[i+1]-1 < K and dp[i-1]+dpz[i-1]-1 < K:
        ans.append(i+1)

if dpz[N-2] < K:
    ans.append(N)

for a in ans:
    print(a)

### FIXED CODE ###

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

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

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,K,C = LI()
S = str(input())

L = []
R = []

for i in range(N):
    if S[i] == 'o':
        if len(L) == 0:
            L.append(i)
        else:
            if L[-1]+C+1 <= i:
                L.append(i)
    if len(L) == K:
        break

for i in range(N)[::-1]:
    if S[i] == 'o':
        if len(R) == 0:
            R.append(i)
        else:
            if R[-1]-C-1 >= i:
                R.append(i)
    if len(R) == K:
        break

R = list(reversed(R))

for i in range(len(L)):
    if L[i] == R[i]:
        print(L[i]+1)
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i)))) <= b:
        ans += i
print(ans)

### FIXED CODE ###

n, a, b = map(int, input().split())
ans = 0
for i in range(n + 1):
    if a <= sum(list(map(int, list(str(i))))) <=b:
        ans += i
print(ans)
int(input())
l = list(map(int, input().split()))
 
l[0] -= 0
 
ans = 'Yes'
for i in range(1,N):
    if l[i-1] < l[i]:
        l[i] -= 1
    elif l[i-1] == l[i]:
        pass
    else:
        ans = 'No'
        break
print(ans)

### FIXED CODE ###

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




for i in range(len(s)-2,-1,-1):    
    if s[i]>s[i+1]:
        s[i]=s[i]-1


        
if s==sorted(s):
    print("Yes")
else:
    print("No")
print(int(input())+Int(input())/2)

### FIXED CODE ###

X, Y = map(int, input().split())

print(int(X + Y/2))
N = int(input())
2 A, B, C = input(), input(), input()
3 ans = 0
4 for i in range(N):
5 ans += len(set([A[i], B[i], C[i]])) - 1
6 print(ans)

### FIXED CODE ###

N = int(input())
A, B, C = input(), input(), input()
ans = 0
for i in range(N):
  ans += len(set([A[i], B[i], C[i]])) - 1
print(ans)
import math
a, b = map(int, input().split())

print(a * b //math.gcd(a,b))

### FIXED CODE ###

from fractions import gcd
a, b = map(int, input().split())

print(a * b //gcd(a,b))
# input
n = int(input())

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

# process
ans = [0]*(n-1)

def f(a, c):
    color = 1
    for b, i in edges[a]:
        if color == c: color += 1
        ans[i] = color 
        f(b, color)
        color += 1

f(0, 0)

# output
print(max(ans))
for i in ans:
    print(i)


### FIXED CODE ###

# input
s = input()

# process
week = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
windex = week.index(s)
ans = 7 if windex == 0 else 7-windex

# output
print(ans)
#input
r_1, c_1, r_2, c_2 = map(int, input().split())

#output
mod = 10**9 + 7

n_ = 10**5 + 3
fun = [1]*(n_+1)
for i in range(1,n_+1):
    fun[i] = fun[i-1]*i%mod
rev = [1]*(n_+1)
rev[n_] = pow(fun[n_],mod-2,mod)
for i in range(n_-1,0,-1):
    rev[i] = rev[i+1]*(i+1)%mod
def cmb(n,r):
    if n <= 0 or r < 0 or r > n: return 0
    return fun[n]*rev[r]%mod*rev[n-r]%mod

answer = 0
for j in range(c_1, c_2+1):
    answer += cmb(r_2+j+1, j+1) % mod - cmb(r_1+j, j+1) % mod

print(answer % mod)

### FIXED CODE ###

#input
r_1, c_1, r_2, c_2 = map(int, input().split())

#output
mod = 10**9 + 7

n_ = 2*10**6 + 1
fun = [1]*(n_+1)
for i in range(1,n_+1):
    fun[i] = fun[i-1]*i%mod
rev = [1]*(n_+1)
rev[n_] = pow(fun[n_],mod-2,mod)
for i in range(n_-1,0,-1):
    rev[i] = rev[i+1]*(i+1)%mod
def cmb(n,r):
    if n <= 0 or r < 0 or r > n: return 0
    return fun[n]*rev[r]%mod*rev[n-r]%mod

answer = 0
for j in range(c_1, c_2+1):
    answer += cmb(r_2+j+1, j+1) % mod - cmb(r_1+j, j+1) % mod

print(answer % mod)
h,w  = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
res = []
for _ in range(h):
    res.append("")
line = 0

def insert(res,i,l):
    if l %2 == 0:
        res[l] = res[l] + str(i+1)
    else:
        res[l] = str(i+1) + res[l]

for i in range(0,n):
    ammount=a[i]
    while len(res[line]) < w and ammount > 0:
        insert(res,i,line)
        ammount -= 1
    if len(res[line]) == w:
        line += 1
    while ammount >= w:
        res[line] = str(i+1) * w
        ammount -= w
        line += 1
    if ammount > 0:
        res[line] = str(i+1) * ammount

length = len(res)
for i in range(length):
    print(res[i])

### FIXED CODE ###

h,w  = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
res = []
for _ in range(h):
    res.append([])
line = 0

def insert(res,i,l):
    if l %2 == 0:
        res[l].append(str(i+1))
    else:
        res[l].insert(0,str(i+1))

for i in range(0,n):
    ammount=a[i]
    while len(res[line]) < w and ammount > 0:
        insert(res,i,line)
        ammount -= 1
    if len(res[line]) == w:
        line += 1
    while ammount >= w:
        res[line] = [str(i+1) for _ in range(w)]
        ammount -= w
        line += 1
    if ammount > 0:
        res[line] = [str(i+1) for _ in range(ammount)]

for i in range(0,h):
    print(' '.join(res[i]))
import numpy as np

H, W = map(int, input().split())

grid = np.zeros((H, W), dtype=int)

for h in range(H):
    S = input()
    for i, s in enumerate(S):
        if s == '#':
            grid[h][i] = 1

# print(grid)


def is_safe(h, w):
    ns = []
    ns.append((h-1, w))
    ns.append((h, w-1))
    ns.append((h+1, w))
    ns.append((h, w+1))

    safe = False
    for n in ns:
        if 0 <= n[0] and n[0] < H \
           and 0 <= n[1] and n[1] < H \
           and grid[n[0]][n[1]] == 1:
            safe = True

    if safe is False:
        print("No")
        exit(0)

    
for h in range(H):
    for w in range(W):
        if grid[h][w] == 1:
            is_safe(h, w)

print("Yes")
exit(0)


### FIXED CODE ###

import numpy as np

H, W = map(int, input().split())

grid = np.zeros((H, W), dtype=int)

for h in range(H):
    S = input()
    for i, s in enumerate(S):
        if s == '#':
            grid[h][i] = 1

# print(grid)


def is_safe(h, w):
    ns = []
    ns.append((h-1, w))
    ns.append((h, w-1))
    ns.append((h+1, w))
    ns.append((h, w+1))

    safe = False
    for n in ns:
        if 0 <= n[0] and n[0] < H \
           and 0 <= n[1] and n[1] < W \
           and grid[n[0]][n[1]] == 1:
            safe = True

    if safe is False:
        print("No")
        exit(0)

    
for h in range(H):
    for w in range(W):
        if grid[h][w] == 1:
            is_safe(h, w)

print("Yes")
exit(0)
n = int(raw_input())
for i in range(n):
    inp = map(str, raw_input().split())
    for j in range(len(inp)):
        if inp[j][:7] == "Hoshino":
           inp[j] = Hoshina" + inp[j][7:]
    print " ".join(map(str, inp))
    

### FIXED CODE ###

for i in [0]*input():print raw_input().replace("Hoshino","Hoshina")
a = input()
b = input()
flag = true
if (a=='H') and (b=='H')
    flag = true
if (a=='H') and (b=='D') 
    flag = false
if (a=='D') and (b=='H') 
    flag = false
if (a=='D') and (b=='d') 
    flag = true
print(flag?H:D)

### FIXED CODE ###

l = input().split()
a = l[0]
b = l[1]
flag = True
if (a=='H' and b=='H'):
    flag = True
if (a=='H' and b=='D'): 
    flag = False
if (a=='D' and b=='H'): 
    flag = False
if (a=='D' and b=='d'): 
    flag = True
print('H' if flag else 'D')
x, n = map(int, input().split())
data = list(map(int, input().split()))

table = [0] * 100
for a in data:
    a -= 1
    table[a] = 1

x -= 1
left = None
idx = x
while idx > 0:
    if table[idx] == 0:
       left = idx
       break
    idx -= 1
idx = x
right = None
while idx < 100:
    if table[idx] == 0:
        right = idx
        break
    idx += 1

lscore = abs(x-left)
rscore = abs(x-right)

if lscore <= rscore:
    print(left+1)
else:
    print(right+1)

### FIXED CODE ###

x, n = map(int, input().split())
data = list(map(int, input().split()))

table = [0] * 102
for a in data:
    table[a] = 1

left = None
idx = x
while idx >= 0:
    if table[idx] == 0:
       left = idx
       break
    idx -= 1
idx = x
right = None
while idx < 102:
    if table[idx] == 0:
        right = idx
        break
    idx += 1

lscore = abs(x-left)
rscore = abs(x-right)

if lscore <= rscore:
    print(left)
else:
    print(right)
from itertools import permutations

while True:
	n = int(raw_input().strip())
	k = int(raw_input().strip())
	if n == k == 0: break
	nums = [raw_input().strip() for i in xrange(n)]
	result = set("".join(p) for p in permutations(nums, k))
	print len(result)

### FIXED CODE ###

import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())
a, b = map(int,input().spilt())

if a < b:
    print(a + "<" + b)
elif a > b:
    print(a + ">" + b)
elif a == b:
    print(a + "==" + b)

### FIXED CODE ###

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

if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
N, K = map(int, input().split())
x = []
y = []
for i in input().split():
    n = int(i)
    if n < 0:
        x.append(-n)
    elif n == 0:
        K -= 1
    else:
        y.append(n)

x = x[::-1]

len_x = len(x)
len_y = len(y)
now = 10 ** 18

if len_x == 0:
    if len_y == 0:
        print(0)
    else:
        print(y[K-1])
elif len_y == 0:
    print(x[K-1])
else:
    for i in range(max(K - len_x, 0), K+1):
        if len_x < i:
            break
        if i == 0:
            now = min(x[K-1], now)
        elif i == K:
            now = min(y[K-1], now)
        else:
            now = min(min(x[i-1], y[K-i-1]) + x[i-1] + y[K-i-1], now)

    print(now)

### FIXED CODE ###

N, K = map(int, input().split())
x = []
y = []
for i in input().split():
    n = int(i)
    if n < 0:
        x.append(-n)
    elif n == 0:
        K -= 1
    else:
        y.append(n)

x = x[::-1]

len_x = len(x)
len_y = len(y)
now = 10 ** 18

if len_x == 0:
    if len_y == 0:
        print(0)
    else:
        print(y[K-1])
elif len_y == 0:
    print(x[K-1])
else:
    for i in range(K+1):
        if K - i > len_y:
            continue
        if len_x < i:
            break
        if i == 0:
            now = min(y[K-1], now)
        elif i == K:
            now = min(x[K-1], now)
        else:
            now = min(min(x[i-1], y[K-i-1]) + x[i-1] + y[K-i-1], now)

    print(now)
N=int(input())
A=[list(map(int,input().split())) for _ in range(2)]

temp=0
for i in range(n):
    temp=max(temp, sum(A[0][:i+1])+sum(A[1][i:]))

print(ans)

### FIXED CODE ###

N=int(input())
A=[list(map(int,input().split())) for _ in range(2)]

temp=0
for i in range(N):
    temp=max(temp, sum(A[0][:i+1])+sum(A[1][i:]))

print(temp)
n=int(input())
h=list(map(int,input().split()))
l=[]
a=0
for i in range(n-1):
    if h[i]>=h[i+1]:
        a+=1
    else:
        l.append(a)
        a=0
print(max(l))


### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
l=[0]*n
for i in range(1,n):
    if h[i]<=h[i-1]:
        l[i]=1+l[i-1]
print(max(l))
from collections import deque

n, q = map(int, input().split())
tree = [list() for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
c = [0] * n
deq = deque()
for i in range(q):
    p, x = map(int, input().split())
    subtree = tree[p-1].copy()
    c[p-1] += x
    while subtree:
        snode = subtree.pop()
        c[snode] += x
        subtree += tree[snode]
print(*c)


### FIXED CODE ###

n, q = map(int, input().split())
tree = [list() for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
c = [0] * n
for i in range(q):
    p, x = map(int, input().split())
    c[p-1] += x

stack = [0]
j = [False] * n # すでに探索したか
while stack:
    node = stack.pop()
    j[node] = True
    for snode in tree[node]:
        if j[snode]:
            continue
        c[snode] += c[node]
        stack.append(snode)

print(*c)
r = int(input)

print(int(r**2))

### FIXED CODE ###

r = int(input())

print(int(r**2))
n = int(input())
book=[]
for i in range(n):
    a,b=input().split()
    temp=[a,int(b),i+1]
    book.append(temp)

book.sort(key = lambda x:x[1])
book.sort(key = lambda x:x[0])

for j in range(len(book)):
    print(book[j][3])

### FIXED CODE ###

n = int(input())
l = [input().split()+[i+1] for i in range(n)]
for i in range(n):
    l[i][1] = int(l[i][1])
l = sorted(l, key=lambda x : x[1], reverse=True)
l = sorted(l, key=lambda x : x[0])
for i in range(n):
    print(l[i][2])
N, K=map(int,input().split())
arr = list(map(int,input().split()))
if(K>= N):
  print('0')
else:
  if (K > 0):
    # for i in range(K):
      # arr.remove(max(arr))
    new_arr = sorted(arr)
    ans = new_arr[:-K]
  print(sum(ans))

### FIXED CODE ###

N, K=map(int,input().split())
arr = list(map(int,input().split()))
if(K>= N):
  print('0')
else:
  if (K > 0):
    new_arr = sorted(arr)
    arr = new_arr[:-K]
  print(sum(arr))
a = list(map(int, input().split()))
print(*a.sort())


### FIXED CODE ###

a = list(map(int, input().split()))
a.sort()
print(" ".join(map(str, a)))
r=0
s=input()
for n in len(s):
  if s[n]!=s[-n]:
    r+=1
print(r/2)


### FIXED CODE ###

r = 0
s = input()
for n in range(len(s)):
  if s[n] != s[-n-1]:
    r += 1
print(r//2)