Harryxun/stf_run huggingface dataset:
s = input()
k = int(input())
sl = []
if len(s) > 1:
    for i in range(len(s)-1):
        for j in range(i, len(s)+1):
            s_part = s[i:j]
            if s_part not in set(sl) and s_part != "" and len(s_part)<= 5:
                sl.append(s_part)
    sll = sorted(sl)
    print(sll[k-1])
else:
    print(s)

### FIXED CODE ###

s = input()
l = int(input())
char = []
if len(s) == 1:
    print(s)
else:
    for i in range(len(s)):
        char.append(s[i])
    charset = set(char)
    ans = []
    for i in charset:
        for j in range(len(s)):
            if i == s[j]:
                for k in range(1, 6):
                    ans.append(s[j:j+k])
    ansset = sorted(list(set(ans)))
    print(ansset[l-1])
a = int(input())
List=[int(i) for i in input().split()]
List.sort()
print(List)
num = 0
ans = []
while num < a:
  res = (List[num] + List[num+1])/2
  ans.append(res)
  resa = (ans[num] + List[num+2])/2
  num = num + 1
  if num == a:
  print(resa)
  break


### FIXED CODE ###

a = int(input())
List=[int(i) for i in input().split()]
k = [1/i for i in List]
m = sum(k)
print(1/m)
import math
def dist(a,b,d):
  distance=0
  for i in range(d):
    distance+=(a[i]-b[i])**2
  return distance
n,d=map(int,input().split())
x=[]
c=0
for i in range(n):
  x.append(list(map(int,input().split())))
for i in range(1,n):
  for j in range(i-1):
    k=dist(x[i],x[j])
    if k==(int(math.sqrt(k)))**2:
      c+=1

### FIXED CODE ###

import math
def dist(a,b,d):
  distance=0
  for i in range(d):
    distance+=(a[i]-b[i])**2
  return distance
n,d=map(int,input().split())
x=[]
c=0
for i in range(n):
  x.append(list(map(int,input().split())))
for i in range(1,n):
  for j in range(i):
    k=dist(x[i],x[j],d)
    if k==(int(math.sqrt(k)))**2:
      c+=1
print(c)
s=str(input())
l=['SUN','MON','TUE','WED','THU','FRI','SAT']
print(7-i)

### FIXED CODE ###

s=input()
l=['SUN','MON','TUE','WED','THU','FRI','SAT']
for i in range(7):
  if s==l[i]:print(7-i)
n,k=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
for i in range(n-k):
    al = sum(l)-l[i]
print(al)

### FIXED CODE ###

n,k=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
al=sum(l)
for i in range(n-k):
    al -= l[i]
print(al)
import sys
import re
import math
import collections
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===

def main():
    x, y, z, w = ns()
    size = [[0, x], [1, y], [2, z]]
    size.sort(key=lambda x: x[1])
    d = []
    for _ in range(3):
        tmp = na()
        tmp.sort(reverse=True)
        d.append(tmp)

    d2 = []
    for i, s in size:
        d2.append(d[i])

    lima = min(size[0][1], 15)
    limb = min(size[1][1], int(math.sqrt(3000 / lima)) + 1)
    limc = min(size[2][1], int(math.sqrt(3000 / lima / limb)) + 1)

    ans = []
    for i in range(lima):
        for j in range(limb):
            for k in range(limc):
                ans.append(d2[0][i] + d2[1][j] + d2[2][k])
    ans.sort(reverse=True)

    for i in range(w):
        print(ans[i])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import re
import math
import collections
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===

def main():
    x, y, z, w = ns()
    a = na()
    b = na()
    c = na()

    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)

    ans = []
    for ai in a:
        for bi in b:
            ans.append(ai + bi)

    ans.sort(reverse=True)
    ans = ans[:3010]

    res = []
    for ci in c:
        for i in range(len(ans)):
            res.append(ci + ans[i])
    res.sort(reverse=True)

    for i in range(w):
        print(res[i])


if __name__ == '__main__':
    main()
n = int(input())
m = list(map(int,input().split()))
o = []
for i in m:
  o.append(float(1/a[i]))
p = sum(o) 
print(1/p)

### FIXED CODE ###

a = int(input())
s = input()
if a >=3200:
  print(s)
else:
  print("red")
while True:
    m,n = map(int,input().split())
    sw = []
    bw = []
    if m == 0 and n == 0:
        break
    for i in range(2*n-1):
        if i % 2 == 0:
            sw.append(list(map(int,input().split())))
        else:
            bw.append(list(map(int,input().split())))
    flag = [[0 for i in range(m)] for j in range(n)]
    l = [(0,0,1)]
    res = 0
    while l:
        bf = l.pop(0)
        if bf[0] == n-1 and bf[1] == m-1:
            res = bf[2]
            break
        flag[bf[0]][bf[1]] = 1
        if 1 <= bf[0] and bw[bf[0]-1][bf[1]] == 0 and flag[bf[0]-1][bf[1]] == 0:
            l.append((bf[0]-1,bf[1],bf[2]+1))
        if bf[1] < m-1 and sw[bf[0]][bf[1]] == 0 and flag[bf[0]][bf[1]+1] == 0:
            l.append((bf[0],bf[1]+1,bf[2]+1))
        if 1 <= bf[1] and sw[bf[0]][bf[1]-1] == 0 and flag[bf[0]][bf[1]-1] == 0:
            l.append((bf[0],bf[1]-1,bf[2]+1))
        if bf[0] < n-1 and bw[bf[0]][bf[1]] == 0 and flag[bf[0]+1][bf[1]] == 0:
            l.append((bf[0]+1,bf[1],bf[2]+1))
    print(res)

### FIXED CODE ###

while True:
    m,n = map(int,input().split())
    sw = []
    bw = []
    if m == 0 and n == 0:
        break
    for i in range(2*n-1):
        if i % 2 == 0:
            sw.append(list(map(int,input().split())))
        else:
            bw.append(list(map(int,input().split())))
    flag = [[0 for i in range(m)] for j in range(n)]
    l = [(0,0,1)]
    res = 0
    while l:
        bf = l.pop(0)
        if bf[0] == n-1 and bf[1] == m-1:
            res = bf[2]
            break
        flag[bf[0]][bf[1]] = 1
        if 1 <= bf[0] and bw[bf[0]-1][bf[1]] == 0 and flag[bf[0]-1][bf[1]] == 0:
            flag[bf[0]-1][bf[1]] = 1
            l.append((bf[0]-1,bf[1],bf[2]+1))
        if bf[1] < m-1 and sw[bf[0]][bf[1]] == 0 and flag[bf[0]][bf[1]+1] == 0:
            flag[bf[0]][bf[1]+1] = 1
            l.append((bf[0],bf[1]+1,bf[2]+1))
        if 1 <= bf[1] and sw[bf[0]][bf[1]-1] == 0 and flag[bf[0]][bf[1]-1] == 0:
            flag[bf[0]][bf[1]-1] = 1
            l.append((bf[0],bf[1]-1,bf[2]+1))
        if bf[0] < n-1 and bw[bf[0]][bf[1]] == 0 and flag[bf[0]+1][bf[1]] == 0:
            flag[bf[0]+1][bf[1]] = 1
            l.append((bf[0]+1,bf[1],bf[2]+1))
    print(res)
N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 3*10**8

for i in range(N-K+1):
    ans1 = abs(x[i])+abs(x[i]-x[i+K-1])
    ans2 = abs(x[i+N-K])+abs(x[i]-x[i+K-1])
    ans = min(ans, ans1, ans2)
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 3*10**8

for i in range(N-K+1):
    ans1 = abs(x[i])+abs(x[i]-x[i+K-1])
    ans2 = abs(x[i+K-1])+abs(x[i]-x[i+K-1])
    ans = min(ans, ans1, ans2)
print(ans)
n, x = map(int, input().split())
a = list(map(int, input().split()))

l = sorted(a)
flag = False
for i in range(n):
    x -= l[i]
    if x < 0:
        flag = True
        break
if flag:
    print(i)
elif x = 0:
    print(n)
elif x > 0:
    print(n - 1)

### FIXED CODE ###

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

l = sorted(a)
flag = False
for i in range(n):
    x -= l[i]
    if x < 0:
        flag = True
        break
if flag:
    print(i)
elif x == 0:
    print(n)
elif x > 0:
    print(n - 1)
A, B = map(int, input().split())


def dv(x1, x2):
    ret = []

    v = min(x1, x2) + 1
    check = [0] * v

    for n in range(2, v):
        if check[n] == 1:
            continue

        if x1 % n == 0 and x2 % n == 0:
            ret.append(n)

            cnt = 2
            while n * cnt <= v:
                check[n * cnt] = 1
                cnt += 1

    return ret


cf = [1] + dv(A, B)
print(len(cf))

### FIXED CODE ###

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


def prime_factorization(n):
    from collections import Counter
    counter = Counter()

    if n < 2:
        return counter

    for i in range(2, int(n ** 0.5) + 1):
        if i * i > n:
            break

        while n % i == 0:
            counter[i] += 1
            n //= i

    if n > 1:
        counter[n] += 1

    return counter


x = prime_factorization(A)
y = prime_factorization(B)

z = set(x.keys()) & set(y.keys())
print(len(z) + 1)
if input() == 1:
    print('Hello World')
else:
    print(int(input()) + int(input()))

### FIXED CODE ###

if input() == '1':
    print('Hello World')
else:
    print(int(input()) + int(input()))
import copy
n,h=map(int,input().split())
ab=[list(map(int,input().split())).append(_) for _ in range(n)]
ab1=copy.copy(ab)
if n==1:print((h-ab[0][1])//ab[0][0]+2)
else:
    ab1.sort()
    ma=ab1[-1][0]
    l=[]
    for i in range(n):
        if ab1[i][0]==ma:l.append(ab1[i])
    l.sort()
    ak=ab.pop(l[0][2])
    ab.sort(key=lambda x:x[1])
    ac=0
    for i in range(1,n):
        if ak[0]>ab[-i][1]:
            h-=ak[0]
            ac+=1
        else:
            h-=ab[-i][1]
            ac+=1
        if h<=0:
            print(ac)
            exit()
    if h<=ak[1]:
        print(ac+1)
    else:
        ac+=((h-ak[1])//ak[0])+1
        print(ac)

### FIXED CODE ###

import copy
n,h=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(n)]
for i in range(n):
    ab[i].append(i)
ab1=copy.copy(ab)
if n==1 and (h-ab[0][1])%ab[0][0]==0:
    print((h-ab[0][1])//ab[0][0]+1)
elif n==1 and (h-ab[0][1])%ab[0][0]!=0:
    print((h-ab[0][1])//ab[0][0]+2)
else:
    ab1.sort()
    ma=ab1[-1][0]
    l=[]
    for i in range(n):
        if ab1[i][0]==ma:l.append(ab1[i])
    l.sort()
    ak=ab.pop(l[0][2])
    ab.sort(key=lambda x:x[1])
    ac=0
    for i in range(1,n):
        if ak[1]>=h:
            h-=ak[1]
            ac+=1
        elif ak[0]>ab[-i][1]:
            h-=ak[0]
            ac+=1
        else:
            h-=ab[-i][1]
            ac+=1
        if h<=0:
            print(ac)
            exit()
    if h<=ak[1]:
        print(ac+1)
    else:
        if (h-ak[1])%ak[0]==0:
            ac+=((h-ak[1])//ak[0])+1
        else:ac+=((h-ak[1])//ak[0])+2
        print(ac)
a,b=map(int,input(),split())
for i in range(2*a-1):
  print(b-a+1+i,end=" ")

### FIXED CODE ###

a,b=map(int,input().split())
for i in range(2*a-1):
  print(b-a+1+i,end=" ")
m = int(input())
return 24-m+24

### FIXED CODE ###

m = int(input())
print(24-m+24)
A = int(input())
B = int(input())

if A >= 13:
    print(B)
elif A <= 5:
    print(0)
else:
    print(B/2)

### FIXED CODE ###

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

if A >= 13:
    print(B)
elif A <= 5:
    print(0)
else:
    print(int(B/2))
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[0:K]　+ "...")

### FIXED CODE ###

N = int(input())
N = N % 10
if N in [2, 4, 5, 7, 9]:
    print('hon')

elif N in [0, 1, 6, 8]:
    print('pon')

else:
    print('bon')
a, b, c = map(int, input().split())
print((a-b) % c)

### FIXED CODE ###

a, b, c = [int(input()) for i in range(3)]
print((a - b) % c)
odd, even = input(), input()

for i in range(len(odd)):
  print(odd[i] + even[i], end="")

print("")


### FIXED CODE ###

odd, even = input(), input()

for i in range(len(even)):
  print(odd[i] + even[i], end="")

if len(odd) == len(even) + 1:
  print(odd[len(odd) - 1])

print("")
import sys
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
if k ==0:
  print(max(a))
  sys.exit()
def check(t):
  ans = 0
  if t==0:
    return False
  for aa in a:
    if aa > t:
      ans += aa//t
  return ans <= k
max = 10**9+1
min = 0
while max-min>1:
  mid = (max+min)//2
  if check(mid):
    max = mid
  else:
    min = mid
print(math.ceil(max))

### FIXED CODE ###

x = int(input())
if x >= 30:
  print("Yes")
else:
  print("No")
k = int(input())
A = list(range(10))

if k <= 9:
    print(A[k])
    exit()


def is_1_keta(i):
    return len(str(i)) == 1


kouho = list(map(str, range(1, 10)))
kouho2 = list(map(str, range(1, 10)))
while True:
    ll = []
    for i in kouho:
        su = list(filter(is_1_keta, [int(i[-1]) - 1, int(i[-1]), int(i[-1]) + 1]))
        l = [f"{i}{x}" for x in su]
        A.extend(l)
        ll.extend(l)
    kouho = ll
    kouho2.extend(ll)
    if len(kouho2) > k:
        break

print(sorted(list(map(int, kouho2)))[k - 1])


### FIXED CODE ###

from bisect import bisect

k = int(input())
A = list(range(10))

if k <= 9:
    print(A[k])
    exit()


def is_1_keta(i):
    return len(str(i)) == 1


kouho = list(map(str, range(1, 10)))
kouho2 = list(map(str, range(1, 10)))
while True:
    ll = []
    for i in kouho:
        su = list(filter(is_1_keta, [int(i[-1]) - 1, int(i[-1]), int(i[-1]) + 1]))
        l = [str(i) + str(x) for x in su]
        A.extend(l)
        ll.extend(l)
    kouho = ll
    kouho2.extend(ll)
    if len(kouho2) > k:
        break

print(sorted(list(map(int, kouho2)))[k - 1])
H, W = map(int, input().split())
maze = [input() for _ in range(H)]
p_flg = [[0]*W for _ in range(H)]
dyx = [(-1,0),(1,0),(0,-1),(0,1)]

def bfn(y,x,cnt):
    stack = [(y,x,cnt)]
    p_flg[y][x] = cnt
    while stack:
        sy, sx, cnt= stack.pop(0)
        cnt += 1
        for dy, dx in dyx:
            ny, nx = sy+dy, sx+dx
            if ny == H-1 and nx == W-1:
                return cnt
            elif 0<=ny<H and 0<=nx<W:
                if maze[ny][nx] !="#" and not p_flg[ny][nx]:
                    p_flg[ny][nx] = cnt
                    stack.append((ny,nx,cnt))

def main():
    n_obs = 0
    for h in range(H):
        for w in range(W):
            if maze[h][w] == "#":
                n_obs += 1
    n_path = bfn(0,0,1) -1
    ans = H*W - n_obs - n_path -1
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

H, W = map(int, input().split())
maze = [input() for _ in range(H)]
p_flg = [[0]*W for _ in range(H)]
dyx = [(-1,0),(1,0),(0,-1),(0,1)]

def bfn(y,x,cnt):
    stack = [(y,x,cnt)]
    p_flg[y][x] = cnt
    while stack:
        sy, sx, cnt= stack.pop(0)
        cnt += 1
        for dy, dx in dyx:
            ny, nx = sy+dy, sx+dx
            if ny == H-1 and nx == W-1:
                return cnt
            elif 0<=ny<H and 0<=nx<W:
                if maze[ny][nx] !="#" and not p_flg[ny][nx]:
                    p_flg[ny][nx] = cnt
                    stack.append((ny,nx,cnt))
    return 0

def main():
    n_obs = 0
    for h in range(H):
        for w in range(W):
            if maze[h][w] == "#":
                n_obs += 1
    n_path = bfn(0,0,1) -1
    if n_path == -1:
        print(-1)
        return
    else:
        ans = H*W - n_obs - n_path -1
        print(ans)

if __name__ == "__main__":
    main()
n = int(input())
h = list(int,input().split())
inf = float("inf")
dp =[inf for i in range(n)]
dp[0] = 0
dp[1] = h[1]
for i in range(2,n):
  dp[i] = min(dp[i-1],dp[i-2])+h[i]
  
print(dp[-1])

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
 
a = [0 for _ in range(n)]
a[1] = abs(h[1] - h[0])
 
for i in range(2,n):
    a[i] = min(a[i-1]+abs(h[i]-h[i-1]), a[i-2]+abs(h[i]-h[i-2]))
    
print(a[-1])
n = int(input())
list = [int(i) for i in input().split()]

list_odd = list[::2]
list_even = list[1::2]

def cnt_element(x):
    dict = {}
    for i in x:
        if i not in dict:
            dict[i] = 1
        else:
            dict[i] += 1
    return [(v,k) for k,v in dict.items()]

cnt_odd = sorted(cnt_element(list_odd),reverse=True)
cnt_even = sorted(cnt_element(list_even),reverse=True)

#最頻値が同じの場合
if cnt_odd[0][1] == cnt_even[0][1]:
    #リスト内の値が１つの場合
    if len(cnt_odd) == len(cnt_even) == 1:
        ans = 1
    #リストが２つ以上の場合
    else:
        #第２最頻値の出現数が奇数の方が多い
        if cnt_odd[1][0] > cnt_even[1][0]:
            ans = n - cnt_odd[1][0] - cnt_even[0][0]
        #第二２最頻値の出現数が偶数の方が多い
        elif cnt_odd[1][0] < cnt_even[1][0]:
            ans = n - cnt_odd[0][0] - cnt_even[1][0]
#最頻値が異なる場合
else:
    ans = n - cnt_odd[0][0] - cnt_even[0][1]

print(ans)

### FIXED CODE ###

from collections import Counter

n = int(input())
v = [int(i) for i in input().split()]

ki = v[::2]
gu = v[1::2]

ki = Counter(ki)
gu = Counter(gu)

ki = ki.most_common()
gu = gu.most_common()

ans = 0

if ki[0][0] == gu[0][0]:
    if len(ki) == 1 and len(gu) == 1:
        ans = int(n / 2)
    else:
        if ki[1][1] > gu[1][1]:
            ans = n - ki[1][1] - gu[0][1]
        else:
            ans = n - ki[0][1] - gu[1][1]
else:
    ans = n - ki[0][1] - gu[0][1]

print(ans)
using namespace std;
 
int main()
{
    int a = 0, b = 0, c = 0;
     
    cin >> a >> b >> c;
     
    if(a < c){
        if(a < b && b < c)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
    else
        cout << "No" << endl;
     
    return 0;
}

### FIXED CODE ###

x = input().split()
 
a = int(x[0])
b = int(x[1])
c = int(x[2])
 
if a < b < c :
    print("Yes")
else :
    print("No")
X, Y, A, B, C = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
 
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
 
Z = 0
while Z < C:
  if min(p[X - 1], q[Y - 1], r[Z]) < r[Z]:
    if p[X - 1] < q[Y - 1]:
      X -= 1
      Z += 1
  	else:
      Y -= 1
      Z += 1
    continue
  break
 
print(sum(p[:X]) + sum(q[:Y]) + sum(r[:Z]))

### FIXED CODE ###

X, Y, A, B, C = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
 
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
 
p.append(float("inf"))
q.append(float("inf")) 

Z = 0
while Z < C:
  if min(p[X - 1], q[Y - 1]) < r[Z]:
    if p[X - 1] < q[Y - 1]:
      X -= 1
      Z += 1
    else:
      Y -= 1
      Z += 1
    continue
  break
 
print(sum(p[:X]) + sum(q[:Y]) + sum(r[:Z]))
N, M = map(int, input().split())
S = []
for _ in range(M):
    S.append(int(input()))
def fib(n):
  if n==-1:
    return 0
  elif n==0:
    return 1
  else:
    a, b = 0, 1
    for i in range(n):
        a, b = b, a + b
    return b
if S[0]==1:
  c=1
else:
  c=fib(S[0]-1)
for i in range(M-1):
  c=c*fib(S[i+1]-S[i]-2)
c=c*fib(N-S[M-1]-1)
c=c%1000000007
print(c)

### FIXED CODE ###

N, M = map(int, input().split())
S = []
for _ in range(M):
    S.append(int(input()))
def fib(n):
  if n==-1:
    return 0
  elif n==0:
    return 1
  else:
    a, b = 0, 1
    for i in range(n):
        a, b = b, a + b
    return b
if len(S)==0:
  c=fib(N)
  print(c%1000000007)
else:
  if S[0]==1:
    c=1
  else:
    c=fib(S[0]-1)
  for i in range(M-1):
    c=c*fib(S[i+1]-S[i]-2)
  c=c*fib(N-S[M-1]-1)
  c=c%1000000007
  print(c)
times = [int(input()) for _ in range(5)]

amarino_times = [i % 10 for i in times]

min_index = amarino_times.index(min(amarino_times))

last_choose_time = times.pop(min_index)


sum = 0
for i in times:
    sum += i
    if i % 10 != 0:
        sum += 10 - (i % 10)

sum += last_choose_time

hoge = 0
for i in amarino_times:
    if i == 0:
        hoge += 1
for i in range(hoge):
    fuga = amarino_times.pop(amarino_times.index(min(amarino_times)))
print(hoge)
if hoge:
    sum -= min(amarino_times)


print(sum)


### FIXED CODE ###

times = [int(input()) for _ in range(5)]

amarino_times = [i % 10 for i in times]
#
# min_index = amarino_times.index(min(amarino_times))
#
# last_choose_time = times.pop(min_index)
#
#
# sum = 0
# for i in times:
#     sum += i
#     if i % 10 != 0:
#         sum += 10 - (i % 10)
#
# sum += last_choose_time
#
# hoge = 0
# for i in amarino_times:
#     if i == 0:
#         hoge += 1
# for i in range(hoge):
#     fuga = amarino_times.pop(amarino_times.index(min(amarino_times)))
# print(hoge)
# if hoge:
#     sum -= min(amarino_times)
#
#
# print(sum)

sum = 0
for i in times:
    if i % 10 == 0:
        sum += i
    else:
        sum += i + 10-i % 10

hoge = []
for i in range(len(amarino_times)):
    if amarino_times[i] != 0:
        hoge.append(amarino_times[i])

if any(amarino_times):
    sum -= (10-min(hoge))

print(sum)
a=int(input())
b=[3,5,7,11,13,17,19]
c=d=0
if a<105:a=104
for i in range(103,a):
    for j in b:
        if a%j==0:c+=1
    if c==3:d+=1
    c=0
print(d)

### FIXED CODE ###

a,b=map(int,input().split())
print((a-1)*(b-1))
while True:
    w, h = map(int, raw_input().split())
    if w == 0 and h == 0:
        break
    tile = []
    for i in range(h):
        tile.append(list(raw_input()))
    print tile
    x = y = 0
    while True:
        a = tile[y][x]
        tile[y][x] = 0
        if   a == ">": x += 1
        elif a == "<": x -= 1
        elif a == "^": y -= 1
        elif a == "v": y += 1
        elif a == ".": print x,y   ; break
        else:            print "LOOP"; break

### FIXED CODE ###

while True:
    h, w = map(int, raw_input().split())
    if w == 0 and h == 0:
        break
    tile = []
    for i in range(h):
        tile.append(list(raw_input()))
    x = y = 0
    while True:
        a = tile[y][x]
        tile[y][x] = 0
        if   a == ">": x += 1
        elif a == "<": x -= 1
        elif a == "^": y -= 1
        elif a == "v": y += 1
        elif a == ".": print x,y; break
        else: print "LOOP"; break
import sys
#input = sys.stdin.readline
#sys.setrecursionlimit(10**6)

def main():
    x,y,a,b,c = map(int, input().split())
    p = list(map(int, input().split()))
    q = list(map(int, input().split()))
    r = list(map(int, input().split()))
    p.sort(reverse = True)
    q.sort(reverse=True)
    r.sort(reverse=True)

    p = p[:x]
    q = q[:y]
    p.sort()
    q.sort()
    cnt = 0
    for er in r:
        if p[cnt] > er and q[cnt] >er:
            cnt += 1
        elif p[cnt] < q[cnt]:
            if p[cnt] < er:
                p[cnt] = er
        else:
            if q[cnt] < er:
                q[cnt] = er



    print(sum(p) + sum(q))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
#input = sys.stdin.readline
#sys.setrecursionlimit(10**6)

def main():
    x,y,a,b,c = map(int, input().split())
    p = list(map(int, input().split()))
    q = list(map(int, input().split()))
    r = list(map(int, input().split()))
    p.sort(reverse = True)
    q.sort(reverse=True)
    r.sort(reverse=True)

    p = p[:x]
    q = q[:y]

    all = []
    all.extend(p)
    all.extend(q)
    all.extend(r)
    all.sort(reverse=True)
    all = all[:x+y]



    print(sum(all))


if __name__ == '__main__':
    main()