Harryxun/stf_run huggingface dataset:
N,M,K=map(int,input("入力してください").split())
costA=list(map(int,input().split()))
costB=list(map(int,input().split()))
costA=[0]+costA
costB=[0]+costB

for i in range(N):
    costA[i+1]+=costA[i]
    
for i in range(M):
    costB[i+1]+=costB[i]

print(costA)
print(costB)

costB.append(float("inf"))

def upper_bound(list1,K):
    low=0
    high=len(list1)-1 #index
    while high-low!=1:
        mid=(high+low)//2
        if list1[mid]>K:
            high=mid
        else:
            low=mid
    return high  #条件を満たす左側の要素数

number=[]
for i in range(N+1): #A側の机の本を固定 残りの時間でBを二分探索
    time=K-costA[i]
    if upper_bound(costB,time)!=1:
        number.append(i+upper_bound(costB,time)-1)
    else:
        number.append(0)
    print(i)
    print(upper_bound(costB,time))
    print(number)
    
print(max(number))

### FIXED CODE ###

N,M,K=map(int,input().split())
costA=list(map(int,input().split()))
costB=list(map(int,input().split()))
costA=[0]+costA
costB=[0]+costB

for i in range(N):
    costA[i+1]+=costA[i]
    
for i in range(M):
    costB[i+1]+=costB[i]

"""print(costA)
print(costB)"""

""

def upper_bound(list1,K):
    low=0
    high=len(list1) #index
    while high-low!=1:
        mid=(high+low)//2
        if list1[mid]>K:
            high=mid
        else:
            low=mid
    return low  #条件を満たす左側の要素数

number=[]
#print(costA)
#print(costB)
for i in range(N+1): #A側の机の本を固定 残りの時間でBを二分探索
    time=K-costA[i]
    if time<0:
        break
    #print(i,upper_bound(costB,time))
    number.append(i+upper_bound(costB,time))

"""print(i)
    print(upper_bound(costB,time))
    print(number)"""
    
print(max(number))



"""
print(cumcost)
#以下二分探索 必要なのはソート済みリストと検索したい値
#upper bound 基準値よりも大きい最初の値を返す
#lower bound 基準値以上の最初の値を返す
#欲しい値はl基準値以下の最大値=upper bound値−１の位置の値
    #冊数は+1なので、求める値はupper_bound
# 検索したい値＝K分を超えない最大の値
low=0
high=len(cumcost)-1
while high-low!=1: #差が１になったら終了
    print(high)
    print(low)
    mid=(high+low)//2 #pythonの//は切り捨て徐算
    if cumcost[mid]>K:  #推測した値が大きすぎた ### 値のダブり注意
        high=mid
    else: # 推測した値小さすぎた#cumcost<=K
        low=mid 
#条件を満たす値の個数 (upper_bound)
    #条件を満たすのが左・・・high
    #条件を満たすのが右・・・len(cumcost)--1-low
upper_bound=high #最終的な値はupper_bound
print(upper_bound)
"""
"""境界線が端っこにあると上手に探索できない
→例外処理で乗り切るか　探索のやり方自体を変更するか　どちらが良いか？"""
import collections
N=list(map(int,input().split(" ")))
list_odd=N[::2]
list_even=N[1::2]
c_odd = collections.Counter(list_odd)
c_even = collections.Counter(list_even)
most_odd=c_odd.most_common()[0][1]
most_even=c_even.most_common()[0][1]
print(len(list_even)+len(list_odd)-most_even-most_odd)

### FIXED CODE ###

import collections
n=int(input())
N=list(map(int,input().split(" ")))
list_odd=N[::2]
list_even=N[1::2]
c_odd = collections.Counter(list_odd)
c_even = collections.Counter(list_even)
most_odd=c_odd.most_common()[0][1]
most_even=c_even.most_common()[0][1]
if (n<=2):
    print("0")
elif (len(list_even)==most_even and len(list_odd)==most_odd and c_odd.most_common()[0][0]==c_even.most_common()[0][0]):
    print(most_odd)
else:
    if(c_odd.most_common()[0][0]==c_even.most_common()[0][0]):
        M=max(c_odd.most_common()[1][1],c_even.most_common()[1][1])
        print(min((len(list_even)+len(list_odd)-M-most_odd),(len(list_even)+len(list_odd)-M-most_even)))
    else:
        print(len(list_even)+len(list_odd)-most_even-most_odd)
#c_odd.most_common()[0][0]==c_even.most_common()[0][0]
N, K, S = map(int,input().split())
L = [S]*K
for i in range(N-K):
  if S < 10**9:
  	L.append(S+1)
  else:
    L.append(1)
  
print(' '.join(map(int, L)))

### FIXED CODE ###

N, K, S = map(int,input().split())
L = [S]*K
for i in range(N-K):
  if S < 10**9:
  	L.append(S+1)
  else:
    L.append(1)
  
print(' '.join(map(str, L)))
a,b=input().split()
c,d=map(int,input().split())
e=int(input())
if e==a:
  c-=1
else:
  d-=1
print(c,d)

### FIXED CODE ###

a,b=input().split()
c,d=map(int,input().split())
e=input()
if e==a:
  c-=1
else:
  d-=1
print(c,d)
n = int(input())
lst = []
for i in range(0,n):
    lst.append(int(input()))
print(lst.sort())


### FIXED CODE ###

input()
print(" ".join(input().split()[::-1]))
N = int(input())

print('ABC'+ N)


### FIXED CODE ###

N = int(input())

print('ABC'+ str(N))
H, W = map(int, input().split())

Ss = [[-1 if c == "#" else 0 for c in input()] for _ in range(H)]

def plus(i, j):
  if 0 <= i < H and 0 <= j < W:
    if Ss[i][j] >= 0:
      Ss[i][j] += 1

for i in range(H):
  for j in range(W):
    for x, y in ((x,y) for x in range(-1, 2) for y in range(-1, 2):
      if x != 0 or y != 0:
        plus(i, j)

for i in range(H):
  for j in range(W):
    print("#" if Ss[i][j] == -1 else Ss[i][j], end="")


### FIXED CODE ###

H, W = map(int, input().split())
 
Ss = [[-1 if c == "#" else 0 for c in input()] for _ in range(H)]
 
def plus(i, j):
  if 0 <= i < H and 0 <= j < W:
    if Ss[i][j] >= 0:
      Ss[i][j] += 1
 
for i in range(H):
  for j in range(W):
    if Ss[i][j] != -1:
      continue
    for x, y in ((x,y) for x in range(-1, 2) for y in range(-1, 2)):
      if x != 0 or y != 0:
        plus(i+x, j+y)
 
for i in range(H):
  for j in range(W):
    print("#" if Ss[i][j] == -1 else Ss[i][j], end="")
  print()
import math
n = 7
x = [1 for i in range(n)]
y = [0 for i in range(n)]
ang = 0
for i in range(2, n):
    ang += math.asin(1/math.sqrt(i - 1))
    x[i] = x[i - 1] + math.cos(ang)
    y[i] = y[i - 1] + math.sin(ang)

while True:
    n = int(input())
    if n == -1:
        break
    print(x[n])
    print(y[n])



### FIXED CODE ###

import math
n = 1001
x = [1 for i in range(n)]
y = [0 for i in range(n)]
ang = 0
for i in range(2, n):
    ang += math.asin(1/math.sqrt(i - 1))
    x[i] = x[i - 1] + math.cos(ang)
    y[i] = y[i - 1] + math.sin(ang)

while True:
    n = int(input())
    if n == -1:
        break
    print(x[n])
    print(y[n])
import numpy as np
N = int(input())
A = [int(i) for i in input().split()]
B = sorted(A.copy(), reverse=True)

ans = 1
counts = [0] * (B[0]+1)
for d in range(B[0], B[-1]//2-1, -1):
    for b in B:
        if b % d == 0:
            counts[d] += 1
            if d != b // d:
                counts[b//d] += 1

    if counts[d] >= N-1:
        ans = d
        break

if ans == 1:
    for i in range(B[0]//2, 0, -1):
        if counts[i] >= N-1:
            ans = i

print(ans)

### FIXED CODE ###

# 解けなかった...orz

N = int(input())
A = [int(i) for i in input().split()]

def gcd(i, j):
    if i <= 0:
        return j
    elif j <= 0:
        return i

    while i != j:
        if i < j:
            j %= i
            if j == 0: return i
        else:
            i %= j
            if i == 0: return j
    return i

# M = [0] * N
L = [0] * (N+1)
R = [0] * (N+1)
# L[0] = 0
# R[N] = 0

for i in range(N):
    L[i+1] = gcd(L[i], A[i])
    R[N-i-1] = gcd(R[N-i], A[N-i-1])

res = max(gcd(L[i], R[i+1]) for i in range(N))
print(res)
S=list(map(int,input().split()))

if (S[0]==S[1]) or (S[1]==S[2]) or (S[2]==S[3]):
  print("Bad")
else:
  print("Good")

### FIXED CODE ###

S=input()

if (S[0]==S[1]) or (S[1]==S[2]) or (S[2]==S[3]):
  print("Bad")
else:
  print("Good")
n,a,b=map(int, input().split())

x=int(n/(a+b))
if x*(a+b)+a <= n:
	print(a*(x+1))
else:
	print(n-b*x)

### FIXED CODE ###

S=input()
if S=="AAA" or S=="BBB":
  print("No")
else:print("Yes")
# run on python 3.4.3
from sys import stdin


def main():
    digits = map(int, stdin.readline())
    dict = {}
    for digit in digits:
        dict[digit] = 1 + dict.get(digit, 0)
    ans = 3 <= max(dict.values())
    print(['No', 'Yes'][ans])


main()


### FIXED CODE ###

# run on python 3.4.3
from sys import stdin


def main():
    n = list(stdin.readline().strip())
    s0 = set()
    s1 = set()
    for i in range(3):
        s0.add(n[i])
    for i in range(1, 4):
        s1.add(n[i])
    ans = len(s0) == 1 or len(s1) == 1
    print(['No', 'Yes'][ans])


main()
N = int(input())
ans = [0]*(N)
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            num = x*x + y*y + z*z + x*y + y*z + z*x
            if num>N:
                break
            ans[num] = ans[num] + 1
for m in ans:
    print(m)


### FIXED CODE ###

N = int(input())
ans = [0]*(N+1)
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            num = x*x + y*y + z*z + x*y + y*z + z*x
            if num>N:
                break
            ans[num] = ans[num] + 1
for m in ans[1:]:
    print(m)
import copy

H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]
ans = copy.deepcopy(S)

dx = [1, 1, 0, -1, -1, -1, 0, 1]
dy = [0, -1, -1, -1, 0, 1, 1, 1]

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            cnt = 0
            for dir in range(8):
                try:
                    cnt += (S[i + dx[dir]][j + dy[dir]] == "#")
                except:
                    pass
            ans[i][j] = cnt
for h in range(H):
    print("".join(ans[h]))

### FIXED CODE ###

import copy

H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]
ans = copy.deepcopy(S)

dx = [1, 1, 0, -1, -1, -1, 0, 1]
dy = [0, 1, 1, 1, 0, -1, -1, -1]

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            cnt = 0
            for dir in range(8):
                if 0 <= i + dy[dir] < H and 0 <= j + dx[dir] < W:
                    cnt += (S[i + dy[dir]][j + dx[dir]] == "#")
                
            ans[i][j] = str(cnt)
for h in range(H):
    print("".join(ans[h]))
def max(arr):
    max = arr[0]
    for i in range(len(arr)):
        if arr[i] > max:
            max = arr[i]
    return max

def calculate(arr,n):

    start = 0
    ret = []

    for i in range(n):
        if i == 0:
            continue
        else:
            if arr[i] > arr[i-1]:
                ret.append(i-1-start)
                start = i

            if i == (len(arr) - 1):
                ret.append(i - start)
    return ret

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

ret = max(calculate(arr,N))
print(ret)

### FIXED CODE ###

def max(arr):
    if len(arr) == 0:
        return 0
    max = arr[0]
    for i in range(len(arr)):
        if arr[i] > max:
            max = arr[i]
    return max

def calculate(arr,n):

    if len(arr) == 0:
        return []

    start = 0
    ret = []

    for i in range(n):
        if i == 0:
            continue
        else:
            if arr[i] > arr[i-1]:
                ret.append(i-1-start)
                start = i

            if i == (len(arr) - 1):
                ret.append(i - start)
    return ret

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

ret = max(calculate(arr,N))
print(ret)
a,b = map(int,input().split())
    print(max(a + b,a - b,a*b))

### FIXED CODE ###

a,b = map(int,input().split())
print(max(a + b,a - b,a*b))
a,b=input().split()
if a%2==0:
  print("Even")
  exit(0)
if a%2==0:
  print("Even")
  exit(0)
print("Odd")

### FIXED CODE ###

a_, b_ = input().split()
a = (int)(a_)
b = (int)(b_)

if a%2==0:
    print("Even")
elif b%2==0:
    print("Even")
else:
    print("Odd")
L1=list(map(int,input().split()))
for i in range(len(l1)):
  if l1[i]==0:
    print(i+1)
    break

### FIXED CODE ###

l1=list(map(int,input().split()))
for i in range(len(l1)):
  if l1[i]==0:
    print(i+1)
    break
N, M = [int(nm) for nm in input().split()]
A = []
for m in range(M):
  A.append(int(input()))

for n in range(N+1):
  if n == 0:
    i1 = 1
  elif n == 1:
    i2 = 1
    if n in A:
      i2 = 0
  else:
    i3 = i1 + i2
    if n in A:
      i3 = 0
    i1, i2 = i2, i3

ans = i3 % (10**9 + 7)
print(ans)

### FIXED CODE ###

N, M = [int(nm) for nm in input().split()]
if M != 0:
  a = int(input())

C = [1, 0] # [-2段目, -1段目]
C += [0]*(N+10) # C = [-2段目, -1段目, 0段目, 1段目, 2段目, ...]
for n in range(0, N+1):
  if M == 0:
    C[n+2] = (C[n] + C[n+1]) % 1000000007
  else: # M > 0:
    if n != a:
      C[n+2] = (C[n] + C[n+1]) % 1000000007
    else: # n == a:
      C[n+2] = 0
      M -= 1
      if M > 0:
        a = int(input())

ans = C[N+2]  % 1000000007
print(ans)
# -*- coding: utf-8 -*-


def main():
    n, k = list(map(int, input().split()))
    x = list(map(int, input().split()))

    if x[0] < 0:
        diff = abs(x[0])

        for i in range(n):
            x[i] += diff

    print(min(x[k - 1]), x[-k])


if __name__ == '__main__':
    main()


### FIXED CODE ###

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


def main():
    n, k = list(map(int, input().split()))
    x = list(map(int, input().split()))
    ans = float('inf')

    for i in range(n - k + 1):
        left = x[i]
        right = x[i + k - 1]

        if left * right >= 0:
            ans = min(ans, max(abs(left), abs(right)))
        else:
            ans = min(ans, 2 * abs(left) + abs(right), abs(left) + 2 * abs(right))

    print(ans)


if __name__ == '__main__':
    main()
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

ans = []

def dfs(m):
    if m == 1:
        ans.append(1)
        return 0
    elif m == 3:
        ans.append(2)
        ans.append(1)
        return 0
    elif m == 4:
        ans.append(3)
        ans.append(1)
        return 0
    elif m == 5:
        ans.append(3)
        ans.append(2)
        return 0
    else:
        k = ceil((sqrt(1+8*m)-1)/2)
        ans.append(k)
        dfs(m-k)

n = INT()
dfs(n)
for x in ans:
    print(x)

### FIXED CODE ###

from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

ans = []

def dfs(m):
    if m == 1:
        ans.append(1)
        return 0
    elif m == 2:
        ans.append(2)
        return 0
    elif m == 3:
        ans.append(2)
        ans.append(1)
        return 0
    elif m == 4:
        ans.append(3)
        ans.append(1)
        return 0
    elif m == 5:
        ans.append(3)
        ans.append(2)
        return 0
    else:
        k = ceil(sqrt(1+8*m))//2
        ans.append(k)
        dfs(m-k)

n = INT()
dfs(n)
for x in ans:
    print(x)
c=input()
z='abcdefghijklmnopqrstuvwxy'
print(z[z.index(c)+1])

### FIXED CODE ###

c=input()
z='abcdefghijklmnopqrstuvwxyz'
print(z[z.index(c)+1])
N=int(input())
A=list(map(int,input().split()))

arr=[A[-1]]
arr.extend(A)
arr.append(A[0])
ans=[]
for i in range(1,N+1):
    ans.append(int(binbin(arr[i])) == int("".join(list(map(lambda x:str(int(x)%2),str(binbin(arr[i-1])+binbin(arr[i+1])))))))

print("Yes" if all(ans) else "No")

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
a=1
for i in A:
    a^=i
print(["No","Yes"][a==1])
import.math
A, B, H, M = map(int, input.split())
sita = (H*30+M*0.5)-(M*6)
if (sita > 180):
  Sita = 360 - sita
elif (0 > sita >= -180):
  Sita = sita * -1
elif (-180 > sita > -360):
  Sita = sita + 360
else:
  Sita = sita
print((A**2+B**2-2*A*B*(math.cos(math.radians(Sita))))**0.5)

### FIXED CODE ###

def resolve():
    import math
    A, B, H, M = map(int, input().split())
    sita = abs(H*30+M*0.5-M*6)
    if sita > 180:
        sita = 360 - sita
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(sita))))
resolve()
mod = (10 ** 9 + 7)
tot = 1
l = [1, 0, 0]
for i in range(3, 2000):
  nex = (tot - l[-1] - l[-2])
  tot = (tot + nex) 
  l.append(nex)
print(l[int(input())])

### FIXED CODE ###

S = int(input())
mod = (10 ** 9 + 7)
if S < 3:
  print(0)
else:
  ans = 1
  max_length = S // 3
  dp = [[-1 for i in range(S-3+1)] for j in range(max_length+1)]
  for diff_size in range(S-3+1):
    for length in range(max_length+1):
      if length == 0:
        dp[length][diff_size] = 0
      elif length == 1 or diff_size == 0:
        dp[length][diff_size] = 1
      elif length == 2:
        dp[length][diff_size] = diff_size + 1
      elif diff_size == 1:
        dp[length][diff_size] = length
      else:
        if dp[length][diff_size] == -1:
          dp[length][diff_size] = dp[length-1][diff_size] + dp[length][diff_size-1]
  for length in range(2, max_length + 1):
    diff = S - length * 3
    ans += dp[length][diff]
    ans %= mod

  print(ans)
import fractions

N, M = map(int, input().split())
S = input()
T = input()
L = N*M//fractions.gcd(N, M)

XS = [' ']*L
XT = [' ']*L

for i in range(N):
  idx = L//N*i
  try:
    XS[idx] = S[i]
  except:
    pass

for i in range(M):
  idx = L//M*i
  try:
    XT[idx] = T[i]
  except:
    pass

  if XS[i] == ' ' or XT[i] == ' ':
    continue
  elif XS[i] == XT[i]:
    continue
  else:
    print(-1)
    exit()

print(L)

### FIXED CODE ###

import sys
import fractions
N, M = map(int, input().split())
S = input()
T = input()

g = fractions.gcd(N, M)
L = N * M // g

ss = L // N
ts = L // M
for i in range(N):
  if (i * ss) % ts == 0:
    j = (i * ss) // ts
    if S[i] != T[j]:
      print(-1)
      sys.exit()

for i in range(M):
  if (i * ts) % ss == 0:
    j = (i * ts) // ss
    if T[i] != S[j]:
      print(-1)
      sys.exit()

print(L)
A, B, K = map(int, input().split())
AB = list(range(A, B+1))
ans = sorted(set(AB[:K]+AB[-K:]))

for i in ans:
    print(i)

### FIXED CODE ###

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

if b-a+1 <= 2*k:
    for num in range(a, b+1):
        print(num)
else:
    for num in range(a, a+k):
        print(num)
    for num in range(b-k+1,b+1):
        print(num)
tmp=input()
tmp=tmp.split('')
a,b=tmp[0],tmp[1]
c=a*b
if c%2 == 0:
	print('Even')
else:
	print('odd')

### FIXED CODE ###

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

c=a*b
if c%2 == 0:
	print('Even')
else:
	print('Odd')
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    ans=cost-((honsu-M)*data[i][0])
print(ans)

### FIXED CODE ###

N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    cost=cost-((honsu-M)*data[i][0])
    print(cost)
    exit()
print(cost)
#include <iostream>
#include <array>

using namespace std;

int main(){
    int N, M, k, val, sum = 0, ans;

    array<int, 100> p;
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> p[i];
        sum += p[i];
    }

    cin >> M;
    for(int i = 0; i < M; i++){
        cin >> k >> val;
        cout << sum + val - p[k - 1] << '\n';
    }
    
}


### FIXED CODE ###

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

M = int(input())
for i in range(M):
    Ml = list(map(int, input().split()))
    print(s + Ml[1] - Nl[Ml[0] - 1])
n,m = map(int,raw_input().split())

arr = []
for i in range(n):
	arr.append(map(int,raw_input().split()))


ans = -10000000
print arr
def check(k,o,f,p,i):
	global ans,m,n
	if i < n:

		if p < m:
			check(k+arr[i][0],o+arr[i][1],f+arr[i][2],p+1,i+1)

		check(k,o,f,p,i+1)

	if p == m:
		ans = max(ans,abs(k)+abs(o)+abs(f))


check(0,0,0,0,0)

print ans

### FIXED CODE ###

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

arr = []

for i in range(n):
	arr.append(map(int,raw_input().split()))

v = [[1,1,1],[1,1,-1],[1,-1,-1],[1,-1,1],[-1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1]]

ans = 0

for i in range(8):
	tmp = []
	for j in range(n):
		tmp.append(arr[j][0] * v[i][0] + arr[j][1] * v[i][1] + arr[j][2] * v[i][2])

	tmp.sort()
	ans = max(ans,sum(tmp[n-m:]))

print ans
a = int(input())
b = int(input())
 
if a*b % 2 == 0:
    print('Even')
else:
    print('Odd')

### FIXED CODE ###

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


if a*b % 2 == 0:
    print('Even')
else:
    print('Odd')
n=int(input())
A=list(map(int,input().split()))
inf=float("inf")
dp=[inf for i in range(n)]
dp[0]=0
dp[1]=abs(A[1]-A[0])
for i in range(2,n):
	dp[i]=min(dp[i],abs(A[i-1]-A[i]),abs(A[i-2]-A[i]))
print(dp[n])

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
inf=float("inf")
dp=[inf for i in range(n)]
dp[0]=0
dp[1]=abs(A[1]-A[0])
for i in range(2,n):
	dp[i]=min(dp[i],abs(A[i-1]-A[i])+dp[i-1],abs(A[i-2]-A[i])+dp[i-2])
print(dp[n-1])
n = int(input())
    n %= 1000

    if n == 0:
        print(0)
    else:
        print(1000 - n)


### FIXED CODE ###

import math
n = int(input())
mod = n/1000
res = (math.ceil(mod)*1000) - n
print(res)
a=list(map(int,input().split()))
if a==b:
  print(max(a)*2)
else:
  print(max(a)*2-1)

### FIXED CODE ###

a,b=list(map(int,input().split()))
c=max([a,b])
if a<b:
    b-=1
else:
    a-=1
d=max([a,b])
print(c+d)
out = []
append = out.append
cnt = int(raw_input())
while cnt > 0:
    trans = {}
    for i in range(cnt):
        k,v = raw_input().split()
        trans[k] = v.rsplit()
    leng = int(raw_input())
    ans = ''
    for i in range(leng):
        load = raw_input().rsplit()
        ans += (load in trans and trans[load]) or load
    print ans
    cnt = int(raw_input())

### FIXED CODE ###

out = []
while True:
  n = int(raw_input())
  if n == 0: break
  trans = {}
  for i in range(n):
    k,v = raw_input().split()
    trans[k] = v.rstrip()
  cnt = int(raw_input())
  res = ""
  for j in range(cnt):
    a = raw_input().rstrip()
    if a in trans: a = trans[a]
    res += a
  out.append(res)
for o in out: print o