Harryxun/stf_run huggingface dataset:
from heapq import *

a,b,c,K = int(input()),int(input()),int(input()),int(input())
A = sorted([int(x) for x in input().split(' ')], reversed=True)
B = sorted([int(x) for x in input().split(' ')], reversed=True)
C = sorted([int(x) for x in input().split(' ')], reversed=True)

res = []
i, j, k = 0, 0, 0
while len(res) < K:
  heappush(res, A[i]+B[j]+C[k])
  heappush(res, A[i+1]+B[j]+C[k])
  heappush(res, A[i]+B[j+1]+C[k])
  heappush(res, A[i]+B[j]+C[k+1])
  i,j,k = i+1, j+1, k+1
res = nlargest(K, res)
for i in res:
  print(i)

### FIXED CODE ###

from heapq import *

X, Y, Z, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
A = sorted([int(x) for x in A], reverse=True)
B = sorted([int(x) for x in B], reverse=True)
C = sorted([int(x) for x in C], reverse=True)

res = []
memo = []
ans = []
heappush(res, (-A[0]-B[0]-C[0], 0, 0, 0))
while len(ans) < K:
  e, i, j, k = heappop(res)
  ans.append(-e)
  if i+1 < X and [i+1, j, k] not in memo:
    heappush(res, (-A[i+1]-B[j]-C[k], i+1, j, k))
    memo.append([i+1, j, k])
  if j+1 < Y and [i, j+1, k] not in memo:
    heappush(res, (-A[i]-B[j+1]-C[k], i, j+1, k))
    memo.append([i, j+1, k])
  if k+1 < Z and [i, j, k+1] not in memo:
    heappush(res, (-A[i]-B[j]-C[k+1], i, j, k+1))
    memo.append([i, j, k+1])

for i in ans:
  print(i)
n=int(input())
p=[map(int,input() for i in range(n))]
q=max(p)
print(sum(p)-q/2)


### FIXED CODE ###

n=int(input())
p=[int(input()) for i in range(n)]
q=max(p)
print(int(sum(p))-int(max(p)/2))
a,b,c = map(int,input().spli())
print("YES" if b-a == c-b else "NO")

### FIXED CODE ###

a,b,c = map(int,input().split())
print("YES" if b-a == c-b else "NO")
n = int(input())

a = [int(x) for x in input().split() if x != "1"]
sum = a[0]

if 0 in a:
        sum = 0
else:
    for i in range(1,len(a)):
        sum = sum * a[i]
        if sum > 10**18:
            break
        


if sum > 10**18:
    print(-1)
else:
    print(sum)

### FIXED CODE ###

n = int(input())

a = [int(x) for x in input().split() ]
sum = a[0]

if 0 in a:
        sum = 0
else:
    for i in range(1,len(a)):
        sum = sum * a[i]
        if sum > 10**18:
            break
        


if sum > 10**18:
    print(-1)
else:
    print(sum)
import copy

def ano_onnano_code(L, x):
  ok = 0
  ng = len(L)
  while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if L[mid] > x:
      ok = mid
    else:
      ng = mid
  if L[ok] < x:
    return ok
  else:
    return ng
      
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

t = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
L = {}
for i in A:
  if t[i] in L:
    if L[t[i]] < i:
      L[t[i]] = i
  else:
    L[t[i]] = i
  
dp = [[] for i in range(N)]

for i in L.items():
  dp[i[0] - 1] = [i[1]]
for i in range(N):
  if dp[i] == []:
    continue
  for j in L.items():
    k = i + j[0]
    if k < N:
      t = copy.deepcopy(dp[i])
      t.insert(ano_onnano_code(t, j[1]), j[1])
      a = dp[k] == []
      b = len(t) > len(dp[k])
      c = t > dp[k]
      if a or b or c:
        dp[k] = t

t = [str(i) for i in dp[-1]]
print("".join(t))

### FIXED CODE ###

import copy

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

t = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
L = {}
for i in A:
  if t[i] in L:
    if L[t[i]] < i:
      L[t[i]] = i
  else:
    L[t[i]] = i

dp = [[0 for j in range(10)] for i in range(N)]
for i in L.items():
  if i[0] - 1 < N:
    dp[i[0] - 1][i[1]] = 1
for i in range(N):
  if max(dp[i]) == 0:
    continue
  for j in L.items():
    k = i + j[0]
    if k < N:
      t = copy.deepcopy(dp[i])
      t[j[1]] += 1
      if sum(t) > sum(dp[k]):
        dp[k] = t
      else:
        for ii in range(9, 0, -1):
          if t[ii] > dp[k][ii]:
            dp[k] = t
            break
          elif t[ii] < dp[k][ii]:
            break
          
t = dp[-1]
Ans = ""
for i in range(9, 0, -1):
  for j in range(t[i]):
    Ans += str(i)
    
print(Ans)
n, m = map(int, input().split())
num = 2//n*(n-1) + 2//m*(m-1)
print(num)

### FIXED CODE ###

n, m = map(int, input().split())
num = ((n**2-n)//2) + ((m**2-m)//2)
print(num)
import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))
k, v = zip(*collections.Counter(a).most_common()[::-1])
v_list = [i for i in v]
diff = max(0, len(v_list - k))
ans = sum(v_list[:diff])
print(ans)

### FIXED CODE ###

import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))
a_cnt = collections.Counter(a).most_common()[::-1]
ans = 0
n = len(list(set(a)))
if n <= k:
    print(0)
    exit()
for v in range(n):
    ans += a_cnt[v][1]
    n -= 1
    if n <= k:
        print(ans)
        exit()
N = int(input())
A = list(map(int, input().split()))
k = max(A)

def pow_k(x, n):
    """
    O(log n)
    """
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x % 998244353
        x *= x % 998244353
        n //= 2

    return K * x % 998244353


R = [0] * (k + 1)
result = 1
for i in A:
    R[i] += 1

if A[0] != 0 or R[0] != 1:
    print(0)
    exit()

for j in range(k + 1):
    result *= pow_k(R[j], R[j + 1])

    if result == 0:
        print(0)
        exit()

print(result % 998244353)


### FIXED CODE ###

N = int(input())

if N % 2 == 0:
    print(N // 2 - 1)
else:
    print((N + 1) // 2 - 1)
import sys
S = [ord(i) for i in input()]
T = [ord(j) for j in input()]
S.sort()
T = sorted(T, reverse=True)
#print(S,T)
for k in range(len(S)):
  if S[k] > T[k]:
    print("No")
    sys.exit()
  elif S[k] < T[k]:
    print("Yes")
    sys.exit()
  else:
    None
if len(S) <= len(T):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

import sys
S = "".join(sorted(input()))
T = "".join(sorted("".join(sorted(input())), reverse=True))
print("Yes" if S < T else "No")
# import sys
# readline = sys.stdin.readline
# generator = (readline().strip() for _ in range(N))

# N, M = map(int, input().split())
# As = list(map(int, input().split()))
# queries = (input() for _ in range(N))


def solve():
    N, M, K = map(int, input().split())

    As = list(map(int, input().split()))
    Bs = list(map(int, input().split()))

    def dfs(n, m, total, count):
        if total > K:
            return count - 1

        if n == N and m == M:
            return count

        if n < N:
            c1 = dfs(n+1, m, total + As[n], count+1)
        else:
            c1 = count

        if m < M:
            c2 = dfs(n, m+1, total + Bs[m], count+1)
        else:
            c2 = count

        return max(c1, c2)

    return dfs(0, 0, 0, 0)


def main():
    print(solve())


if __name__ == "__main__":
    main()


### FIXED CODE ###

from bisect import bisect_right


def solve():
    N, M, K = map(int, input().split())

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

    sum_as = [0] * (N+1)
    sum_bs = [0] * (M+1)

    for i, a in enumerate(A):
        sum_as[i+1] = sum_as[i] + a

    for i, b in enumerate(B):
        sum_bs[i+1] = sum_bs[i] + b
    sum_bs = sum_bs[1:]

    answer = 0
    for i, sa in enumerate(sum_as):
        remain = K - sa
        if remain < 0:
            continue
        
        idx = bisect_right(sum_bs, remain)
        answer = max(answer, i + idx)

    return answer


def main():
    print(solve())


if __name__ == "__main__":
    main()
A = input()
B = input()

if 1 <= A <= 20 & 1 <= B <= 20 :
    print(A * B)

else :
    print(-1)

### FIXED CODE ###

AB = input().split()
A = int(AB[0])
B = int(AB[1])

if 1 <= A <= 9 and 1 <= B <= 9 :
    print(A * B)

else :
    print(-1)
N, M = [int(a) for a in input().split()]
lol = []
for i in range(M):
  a, b = [int(a) for a in input().split()]
  found_a = -10
  found_b = -10
  for j in range(len(lol)):
    if a in lol[j]:
      found_a = j
    if b in lol[j]:
      found_b = j
    if found_a >= 0 and found_b >= 0:
      break
  
  if found_a < 0 and found_b < 0:
    lol.append([a,b])
  elif found_a >= 0 and found_b < 0:
    lol[found_a].append(b)
  elif found_b >= 0 and found_a < 0:
    lol[found_b].append(a)
  elif found_a >= 0 and found_b >=0 and found_a != found_b:
    lol[found_a] += lol[found_b]
    lol.pop(found_b)
    
ans = max([len(z) for z in lol])

print(ans)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]    
      
def program():
  N, M = map(int, input().split())
  uf = UnionFind(N)
  for i in range(M):
    a, b = map(int, input().split())
    uf.union(a-1,b-1)
  
  ans = max([uf.size(i) for i in range(N)])
  return ans

print(program())
# -*- coding: utf-8 -*-
def check(z, zz, z_list, dire):
  zz += z_list[0] * dire
  if len(z_list) == 1:
    if z == zz:
      return 1
    else:
      return 0
  else:
    if check(z, zz, z_list[1:], 1) == 0 and check(z, zz, z_list[1:], 1) == 0:
      return 0
    else:
      return 1

    
def func(x, y, xx, yy, x_list, y_list):
  if len(x_list) == 0:
    if x != xx:
      return 0
  else:
    if check(x, xx, x_list, 1) == 0 and check(x, xx, x_list, -1) == 0:
      return 0
  if len(y_list) == 0:
    if y != yy:
      return 0
  else:
    if check(y, yy, y_list, 1) == 0 and check(y, yy, y_list, -1) == 0:
      return 0
  return 1

s = input()
x, y = map(int, input().split())
data = s.split("T")
xx, yy = 0, 0
i = 0
x_list = []
y_list = []
for Fs in data:
  if len(Fs) == 0:
    i += 1
  else:
    if i == 0:
      xx = len(Fs)
    elif i % 2 == 0:
      x_list.append(len(Fs))
    else:
      y_list.append(len(Fs))
    i += 1
if func(x, y, xx, yy, x_list, y_list) == 1:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

# -*- coding: utf-8 -*-
def check(z, zz, z_list):
  if len(z_list) == 0:
    if z != zz:
      return 0
    else:
      return 1
  else:
    z_n = len(z_list)
    z_hash = {}
    z_hash[0] = {}
    z_hash[0][zz] = 1
    z_hash[z_n] = {}
    z_hash[z_n][z] = 1
    for i in range(0,z_n):
      if i+1 not in z_hash:
        z_hash[i+1] = {}
        for b_z in z_hash[i]:
          a_z = b_z + z_list[i]
          z_hash[i+1][a_z] = 1
          a_z = b_z - z_list[i]
          z_hash[i+1][a_z] = 1
      else:
        for b_z in z_hash[i]:
          a_z = b_z + z_list[i]
          if a_z in z_hash[i+1]:
            return 1
          a_z = b_z - z_list[i]
          if a_z in z_hash[i+1]:
            return 1
        return 0
      if z_n-i-1 not in z_hash:
        z_hash[z_n-i-1] = {}
        for a_z in z_hash[z_n-i]:
          b_z = a_z + z_list[z_n-i-1]
          z_hash[z_n-i-1][b_z] = 1
          b_z = a_z - z_list[z_n-i-1]
          z_hash[z_n-i-1][b_z] = 1
      else:
        for a_z in z_hash[z_n-i]:
          b_z = a_z + z_list[z_n-i-1]
          if b_z in z_hash[z_n-i-1]:
            return 1
          b_z = a_z - z_list[z_n-i-1]
          if b_z in z_hash[z_n-i-1]:
            return 1
        return 0



s = input()
x, y = map(int, input().split())
data = s.split("T")
xx, yy = 0, 0
i = 0
x_list = []
y_list = []
for Fs in data:
  if len(Fs) == 0:
    i += 1
  else:
    if i == 0:
      xx = len(Fs)
    elif i % 2 == 0:
      x_list.append(len(Fs))
    else:
      y_list.append(len(Fs))
    i += 1
if check(x, xx, x_list) == 1 and check(y, yy, y_list) == 1:
  print("Yes")
else:
  print("No")
a,b,c = map(int, raw_input())
if a < b < c :
    print("Yes")
else :
    print("No")

### FIXED CODE ###

a,b,c = map(int, raw_input().split(" "))
if a < b < c :
    print("Yes")
else :
    print("No")
S = list(input())
S[3] = 8
print("".join(S))


### FIXED CODE ###

S = list(input())
S[3] = "8"
a = "".join(S)
print(a)
S = input()
 
if S == 'ABC':
  print(ARC)
else:
  print(ABC)

### FIXED CODE ###

S = input()
 
if S == 'ABC':
  print('ARC')
else:
  print('ABC')
a,b = map(int,input().split())

if a>b:
  print("GREATER")
  
elif a = b:
  print("EQUAL")
  
else:
  print("LESS")

### FIXED CODE ###

a = int(input())
b = int(input())
if a>b:
  print("GREATER")
  
elif a == b:
  print("EQUAL")
  
else:
  print("LESS")
from decimal import Decimal
a, b, c = map(int, input().split())
if Decimal(a) ** Decimal('0.5') + Decimal(b) ** Decimal('0.5') < Decimal(c)c ** Decimal('0.5'):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

from decimal import Decimal
a, b, c = map(int, input().split())
if Decimal(a) ** Decimal('0.5') + Decimal(b) ** Decimal('0.5') < Decimal(c) ** Decimal('0.5'):
    print('Yes')
else:
    print('No')
a=int(input("enter a no"))
b=int(input("enter a no"))

if a>2b:
	print(a-2b)


else:
	print(0)


### FIXED CODE ###

a, b = [int(x) for x in input().split()]
ans = a - 2*b

if(ans < 0):
		ans=0

print(ans)
n=input()
import math
a = []
for i in range(0,math.ceil(n/2),2):
  a.append(a[i])
print(*a)

### FIXED CODE ###

n=input()
a = []
a.append(str(n[:len(n):2]))
print(*a)
import java.util.*;
public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int W = in.nextInt();
        int w[] = new int[N];
        int v[] = new int[N];
        for(int i=0;i<N;i++){
            w[i] = in.nextInt();
            v[i] = in.nextInt();
        }
        in.close();
        long dp[][] = new long[N+1][W+1];
        for(int i=0;i<W+1;i++){
            dp[N][i] = 0;
        }
        for(int i=N-1;i>=0;i--){
            for(int j=0;j<W+1;j++){
                if(j < w[i]){
                    dp[i][j] = dp[i+1][j];
                }
                else{
                    dp[i][j] = Math.max(dp[i+1][j],dp[i+1][j-w[i]]+v[i]);
                }
            }
        }
        System.out.println(dp[0][W]);
    }
}

### FIXED CODE ###

import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)



        
def main(): #startline--------------------------------------------
    N,W = map(int,input().split())
    wv = [list(map(int,input().split())) for i in range(N)]
    w = [wv[i][0] for i in range(N)]
    v = [wv[i][1] for i in range(N)]
    dp = [[0]*(W+1) for i in range(N+1)]
    for i in range(W):
        dp[N][i] = 0
    for i in range(N-1,-1,-1):
        for j in range(W+1):
            if j < w[i]:
                dp[i][j] = dp[i+1][j]
            else:
                dp[i][j] = max(dp[i+1][j],dp[i+1][j-w[i]]+v[i])
    print(dp[0][W])
if __name__ == "__main__":
    main() #endline===============================================
ls = list(map(str,input()))
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
n = len(ls)
for i in range(int((n-1)/2)):
    a.append(ls[i])
for j in range(int((n+1)/2),n):
    b.append(ls[j])
b.reverse()
if b != a:
    print('No')
else:
    if (n-1) % 4 ==0:
        for k in range(int((n-1)/4)):
            c.append(a[i])
        for l in range(int((n-1)/4),(n-1)/2):
            d.append(a[i])
        for m in range(int((n-1)/4)):
            e.append(b[i])
        for n in range(int((n-1)/4),int((n-1)/2)):
            f.append(b[i])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
    else:
        for k in range(int((n-3)/4)):
            c.append(a[i])
        for l in range(int((n+1)/4),int((n-1)/2)):
            d.append(a[i])
        for m in range(int((n-3)/4)):
            e.append(b[i])
        for n in range(int((n+1)/4),int((n-1)/2)):
            f.append(b[i])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
        


### FIXED CODE ###

ls = list(map(str,input()))
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
n = len(ls)
for i in range(int((n-1)/2)):
    a.append(ls[i])
for j in range(int((n+1)/2),n):
    b.append(ls[j])
b.reverse()
if b != a:
    print('No')
else:
    if (n-1) % 4 ==0:
        for k in range(int((n-1)/4)):
            c.append(a[k])
        for l in range(int((n-1)/4),int((n-1)/2)):
            d.append(a[l])
        for m in range(int((n-1)/4)):
            e.append(b[m])
        for n in range(int((n-1)/4),int((n-1)/2)):
            f.append(b[n])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
    else:
        for k in range(int((n-3)/4)):
            c.append(a[k])
        for l in range(int((n+1)/4),int((n-1)/2)):
            d.append(a[l])
        for m in range(int((n-3)/4)):
            e.append(b[m])
        for n in range(int((n+1)/4),int((n-1)/2)):
            f.append(b[n])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
n = int(input())
arr = sorted(list(map(int, input().split())))
res = 0
for i in range(0, n - 2):
	for j in range(i, n - 1):
		for k in range(j, n):
			if arr[i] + arr[j] > arr[k] and arr[i] != arr[j] and arr[j] != arr[k] and arr[i != arr[k]:
 				res += 1
print(res)
                                                                                          
    
      
  	


### FIXED CODE ###

n = int(input())
arr = sorted(list(map(int, input().split())))
res = 0
for i in range(0, n - 2):
	for j in range(i, n - 1):
		for k in range(j, n):
			if arr[i] + arr[j] > arr[k] and arr[i] != arr[j] and arr[j] != arr[k] and arr[i] != arr[k]:
 				res += 1
print(res)
N=int(input())

if N < 10:
  print(N)
  
elif N < 100:
  print(9)
  
elif N < 1000:
  print(9+ N-99)
  
elif N < 10000:
  print(909)

elif N < 100000:
  print(909 + N - 9999)

else:
  print(90909)


### FIXED CODE ###

A, B, C = (int(i) for i in input().split(" "))
 
D = A - B

 
if C - D <= 0:
  print(0)
else:
  print(C-D)
L, R = map(int, input().split())

result = 2019

for i in range(2019):
    if L+i > R-1:
        break;
    for j in range(i+1, 2019):
        if(L+j > R):
            break
        else:
            result = min(result,((L+i)*(L+j))%2019)

print(result)

### FIXED CODE ###

N,A,B = map(int, input().split())
print(min(N*A,B))
N, M = map(int,input().split())

if M == 1:
    L, R = map(int,input().split())
    l = [k+L for k in range(R-L+1)]
    print(len(l))
else:
    L, R = map(int,input().split())
    l = [k+L for k in range(R-L+1)]
    l_tmp = copy.deepcopy(l)

    L, R = map(int,input().split())
    l = [k+L for k in range(R-L+1)]

    l_set = list(set(l) & set(l_tmp))
    l_tmp = copy.deepcopy(l)
    for i in range(M-2):
        L, R = map(int,input().split())
        l = [k+L for k in range(R-L+1)]

        l_set = list(set(l) & set(l_set))
        l_tmp = copy.deepcopy(l)

    print(len(l_set))

### FIXED CODE ###

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

Ls, Rs = [0 for _ in range(M)],  [0 for _ in range(M)]

for i in range(M):
    L, R = map(int,input().split())
    Ls[i] = L
    Rs[i] = R
    
L_prime = max(Ls)
R_peime = min(Rs)

if L_prime > R_peime:
    print(0)
else:
    print(R_peime - L_prime + 1)
S,C = map(int,input().split())
if C >= S*2:ans = S
ans += (C-ans*2) // 4
print(ans)

### FIXED CODE ###

S,C = map(int,input().split())
if C <= 1:ans = 0
elif C//2 >= S:ans = S+(C-S*2) //4
else:ans = C//2
print(ans)
import math
from functools import reduce
from itertools import product
import numpy

def gcd(*numbers):
    return reduce(math.gcd, numbers)

n = int(input())

l = product(range(1, 1+n), repeat=3)

print(numpy.cumsum([gcd(*i) for i in l])[-1])

### FIXED CODE ###

n = input()
if "7" in n:
    print("Yes")
else:
    print("No")
input()
a = map(int, raw_input().split())

for i in range(a.length(), 1):
    print a[i-1],

### FIXED CODE ###

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

a.reverse()
print(" ".join(map(str, a)))
A, B, X = map(int,input().split())

min_num = 0
max_num = 10 ** 9
#２分探索
# まず、最大値の10**9が購入できるか判定
if A * max_num + B * 9 <= X:
    print(max_num)
    exit()

while(1):
    ave_num = (min_num + max_num)//2 # get a center number
    price = A * ave_num + B * len(str(ave_num)) # price = f(ave_num)
    #print(ave_num,"_",min_num, "_", max_num)
    if min_num + 1 == max_num:
        print(min_num)
        break
    elif min_num == max_num:
        print(min_num)
        break

    elif X >= price:         # bottom down 
        min_num = ave_num
    else:                   # top up
        max_num = ave_num



### FIXED CODE ###

S = input()

if S == "SUN":
    print("7")
elif S == "MON":
    print("6")
elif S == "TUE":
    print("5")
elif S == "WED":
    print("4")
elif S == "THU":
    print("3")
elif S == "FRI":
    print("2")
elif S == "SAT":
    print("1")
l=list(map(int,input()))
print(l.index(0))

### FIXED CODE ###

l=list(map(int,input().split()))
print(l.index(0)+1)
import numpy as np, math
A = [int(input()) for _ in range(5)]
A.sort()
print([(i//10+1)*10 for i in A])
print(sum([math.ceil(i/10)*10 for i in A])  -max([10-i for i in [ (i % 10) for i in A] if i != 0]))



### FIXED CODE ###

import math
A = [int(input()) for _ in range(5)]
print(sum([math.ceil(i/10)*10 for i in A])  -max([10-i for i in [ (i % 10) for i in A] if i != 0] +[0]))
S = input()
print(len([True for s in range(len(S)//2) if S[i] != S[-1-i]]))

### FIXED CODE ###

S = input()
print(len([True for i in range(len(S)//2) if S[i] != S[-1-i]]))
a,b,c=list(map(int,input().split()))
print('YES') if a*b*c*%4==0 else print('NO')

### FIXED CODE ###

a,b,c=list(map(int,input().split()))
print('YES') if (100*a+10*b+c)%4==0 else print('NO')