You are going to eat X red apples and Y green apples.

You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C.

Before eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.

From the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.

Find the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.

-----Constraints-----
 - 1 \leq X \leq A \leq 10^5
 - 1 \leq Y \leq B \leq 10^5
 - 1 \leq C \leq 10^5
 - 1 \leq p_i \leq 10^9
 - 1 \leq q_i \leq 10^9
 - 1 \leq r_i \leq 10^9
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
X Y A B C
p_1 p_2 ... p_A
q_1 q_2 ... q_B
r_1 r_2 ... r_C

-----Output-----
Print the maximum possible sum of the deliciousness of the eaten apples.

-----Sample Input-----
1 2 2 2 1
2 4
5 1
3

-----Sample Output-----
12

The maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:
 - Eat the 2-nd red apple.
 - Eat the 1-st green apple.
 - Paint the 1-st colorless apple green and eat it.

Difficulty: MEDIUM

Solutions:
(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)
hoge = p[:X] + q[:Y] + r
hoge.sort(reverse=True)
print(sum(hoge[:X + Y]))


(x, y, aa, bb, cc) = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
ary = a[:x] + b[:y] + c
ary.sort(reverse=True)
print(sum(ary[:x + y]))


(X, Y, A, B, C) = list(map(int, input().split()))
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)
pqr = sorted(p[:X] + q[:Y] + r, reverse=True)
print(sum(pqr[:X + Y]))


(x, y, a, b, c) = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
ABC = A[:x] + B[:y] + C
ABC.sort(reverse=True)
print(sum(ABC[:x + y]))


(X, Y, A, B, C) = map(int, input().split())
P = sorted(map(int, input().split()), reverse=True)[:X]
Q = sorted(map(int, input().split()), reverse=True)[:Y]
R = sorted(P + Q + list(map(int, input().split())), reverse=True)[:X + Y]
print(sum(R))


(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[0:X]
Q = q[0:Y]
N = P + Q + r
N.sort(reverse=True)
print(sum(N[0:X + Y]))


(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 += p[:x] + q[:y]
r.sort(reverse=True)
ans = 0
for i in range(x + y):
	ans += r[i]
print(ans)


def MI():
	return map(int, input().split())

def LI():
	return list(MI())
(x, y, a, b, c) = MI()
p = sorted(LI())[::-1][:x]
q = sorted(LI())[::-1][:y]
r = sorted(LI())[::-1]
u = sorted(p + q + r)[::-1][:x + y]
print(sum(u))


(X, Y, A, B, C) = map(int, input().split())
P = sorted([int(i) for i in input().split()], reverse=True)
Q = sorted([int(i) for i in input().split()], reverse=True)
R = sorted([int(i) for i in input().split()])
S = sorted(P[:X] + Q[:Y] + R, reverse=True)
print(sum(S[:X + Y]))


(x, y, a, b, c) = map(int, input().split())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
al.sort(reverse=True)
bl.sort(reverse=True)
z = al[:x] + bl[:y] + cl
z.sort(reverse=True)
print(sum(z[:x + y]))


(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)
L = P[:x] + Q[:y] + R
L.sort(reverse=True)
print(sum(L[:x + y]))


(X, Y, A, B, C) = map(int, input().split())
(*p,) = map(int, input().split())
(*q,) = map(int, input().split())
(*r,) = map(int, input().split())
p.sort(key=lambda x: -x)
q.sort(key=lambda x: -x)
p = p[:X]
q = q[:Y]
pqr = p + q + r
pqr.sort(key=lambda x: -x)
print(sum(pqr[:X + Y]))


(x, y, a, b, c) = map(int, input().split())
p = sorted(list(map(int, input().split())))[::-1]
q = sorted(list(map(int, input().split())))[::-1]
r = list(map(int, input().split()))
p1 = p[:x]
q1 = q[:y]
l = sum(sorted(p1 + q1 + r)[::-1][:x + y])
print(l)


(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)
s = p[:x] + q[:y]
s.sort()
ans = sum(s)
for (si, ri) in zip(s, r):
	if si < ri:
		ans += ri - si
print(ans)


(X, Y, A, B, C) = map(int, input().split())
(p, q, r) = [sorted(map(int, input().split()), reverse=True) for i in range(3)]
ans = 0
(pp, qq) = ([p[i] for i in range(X)], [q[i] for i in range(Y)])
r = r + pp + qq
r = sorted(r, reverse=True)
for i in range(X + Y):
	ans += r[i]
print(ans)


from collections import deque
(X, Y, A, B, C) = map(int, input().split())
Q_A = list(map(int, input().split()))
Q_B = list(map(int, input().split()))
Q_C = list(map(int, input().split()))
Q_A = sorted(Q_A, reverse=True)[:X]
Q_B = sorted(Q_B, reverse=True)[:Y]
Q_C = sorted(Q_C, reverse=True)
cand = Q_A + Q_B + Q_C
cand = sorted(cand, reverse=True)
print(sum(cand[:X + Y]))


def main():
	import sys

	def input():
		return sys.stdin.readline().rstrip()
	(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 = p[:x] + q[:y] + r
	r.sort(reverse=True)
	print(sum(r[:x + y]))

def __starting_point():
	main()
__starting_point()


(X, Y, A, B, C) = [int(x) for x in input().split()]
p = sorted([int(x) for x in input().split()], reverse=True)[:X]
q = sorted([int(x) for x in input().split()], reverse=True)[:Y]
r = sorted([int(x) for x in input().split()], reverse=True)[:X + Y]
s = sorted(p + q + r, reverse=True)
ans = sum(s[:X + Y])
print(ans)


def LI():
	return list(map(int, input().split()))
(X, Y, A, B, C) = LI()
red = LI()
green = LI()
mu = LI()
red.sort(reverse=True)
green.sort(reverse=True)
ans = red[:X] + green[:Y] + mu
ans.sort(reverse=True)
total = 0
for i in range(X + Y):
	total += ans[i]
print(total)


import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def main():
	(X, Y, A, B, C) = list(map(int, readline().split()))
	P = list(map(int, readline().split()))
	Q = list(map(int, readline().split()))
	R = list(map(int, readline().split()))
	P.sort(reverse=True)
	Q.sort(reverse=True)
	apple = P[:X] + Q[:Y] + R
	apple.sort(reverse=True)
	print(sum(apple[:X + Y]))
	return

def __starting_point():
	main()
__starting_point()


(x, y, a, b, c) = map(int, input().split())
p = sorted(list(map(int, input().split())))[::-1][:x]
q = sorted(list(map(int, input().split())))[::-1][:y]
r = sorted(list(map(int, input().split())))[::-1]
r = r[:min(len(r), x + y)]
l = sum([p, q, r], [])
print(sum(sorted(l)[::-1][:x + y]))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, bisect
import sys
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
stdin = sys.stdin
ni = lambda : int(ns())
nf = lambda : float(ns())
na = lambda : list(map(int, stdin.readline().split()))
nb = lambda : list(map(float, stdin.readline().split()))
ns = lambda : stdin.readline().rstrip()
(X, Y, A, B, C) = na()
p = na()
q = na()
r = na()
p.append(inf)
q.append(inf)
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
s1 = sum(p[1:X + 1])
s2 = sum(q[1:Y + 1])
p_idx = X
q_idx = Y
ans = s1 + s2
for i in range(C):
	now_r = r[i]
	now_p = p[p_idx]
	now_q = q[q_idx]
	if now_r <= now_p and now_r <= now_q:
		break
	elif now_r > now_p and now_r > now_q:
		if now_p > now_q:
			ans = ans + now_r - now_q
			q_idx -= 1
		else:
			ans = ans + now_r - now_p
			p_idx -= 1
	elif now_r > now_p:
		ans = ans + now_r - now_p
		p_idx -= 1
	elif now_r > now_q:
		ans = ans + now_r - now_q
		q_idx -= 1
print(ans)


(x, y, a, b, c) = map(int, input().split())
p = sorted(map(int, input().split()), reverse=True)[:x]
q = sorted(map(int, input().split()), reverse=True)[:y]
r = list(map(int, input().split()))
ls = sorted(p + q + r, reverse=True)[:x + y]
print(sum(ls))


I = lambda : sorted([int(a) for a in input().split()])[::-1]
(X, Y, *_) = map(int, input().split())
print(sum(sorted(I()[:X] + I()[:Y] + I())[::-1][:X + Y]))


(x, y, a, b, c) = map(int, input().split())
P = sorted(list(map(int, input().split())))[::-1]
Q = sorted(list(map(int, input().split())))[::-1]
R = list(map(int, input().split()))
L = sorted(P[:x] + Q[:y] + R)[::-1]
print(sum(L[:x + y]))


(X, Y, A, B, C) = list(map(int, input().split()))
P = sorted(map(int, input().split()), reverse=True)[:X]
Q = sorted(map(int, input().split()), reverse=True)[:Y]
R = sorted(map(int, input().split()), reverse=True)
PQ = sorted(P + Q)
ans = sum(PQ)
for (r, pq) in zip(R, PQ):
	if r > pq:
		ans += r - pq
print(ans)


(x, y, a, b, c) = map(int, input().split())
datp = sorted(list(map(int, input().split())), reverse=True)
datq = sorted(list(map(int, input().split())), reverse=True)
datr = list(map(int, input().split()))
dat = sorted(datp[:x] + datq[:y] + datr, reverse=True)
print(sum(dat[:x + y]))


(x, y, a, b, c) = map(int, input().split())
p = [int(x) for x in input().rstrip().split()]
q = [int(x) for x in input().rstrip().split()]
r = [int(x) for x in input().rstrip().split()]
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
p = p[:x]
q = q[:y]
pq = p + q
pqr = pq + r
pqr.sort(reverse=True)
print(sum(pqr[:x + y]))


(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 = p[:x]
q = q[:y]
eat = p + q + r
eat.sort(reverse=True)
eat = eat[:x + y]
print(sum(eat))


(X, Y, A, B, C) = map(int, input().split())
ps = sorted(map(int, input().split()), reverse=True)[:X]
qs = sorted(map(int, input().split()), reverse=True)[:Y]
rs = list(map(int, input().split()))
print(sum(sorted(ps + qs + rs, reverse=True)[:X + Y]))


(X, Y, A, B, C) = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())))
ans = sum(sorted(a[0:X] + b[0:Y] + c, reverse=True)[0:X + Y])
print(ans)


mis = lambda : map(int, input().split())
lmis = lambda : list(mis())

def main():
	(X, Y, A, B, C) = mis()
	p = sorted(lmis(), reverse=True)[:X]
	q = sorted(lmis(), reverse=True)[:Y]
	r = lmis()
	print(sum(sorted(p + q + r, reverse=True)[:X + Y]))
main()


(X, Y, A, B, C) = map(int, input().split())
p = sorted(list(map(int, input().split())))[::-1]
q = sorted(list(map(int, input().split())))[::-1]
r = sorted(list(map(int, input().split())))[::-1]
i = X - 1
j = Y - 1
k = 0
p.append(float('INF'))
q.append(float('INF'))
r.append(-1)
while p[i] < r[k] or q[j] < r[k]:
	if p[i] < q[j]:
		i -= 1
		k += 1
	else:
		j -= 1
		k += 1
ans = 0
if i != -1:
	ans += sum(p[:i + 1])
if j != -1:
	ans += sum(q[:j + 1])
if k != 0:
	ans += sum(r[:k])
print(ans)


[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)
S = P[0:X] + Q[0:Y] + R
S.sort(reverse=True)
print(sum(S[0:X + Y]))


from collections import deque
(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()))
ALL = p + q + r
ALL.sort(reverse=True)
ALL = deque(ALL)
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
p = deque(p)
q = deque(q)
r = deque(r)
ans = 0
p_cnt = 0
q_cnt = 0
r_cnt = 0
loopcnt = 0
while loopcnt < X + Y:
	apple = ALL.popleft()
	if p_cnt < X and apple == p[0]:
		ans += p.popleft()
		p_cnt += 1
		loopcnt += 1
	elif q_cnt < Y and apple == q[0]:
		ans += q.popleft()
		q_cnt += 1
		loopcnt += 1
	elif r_cnt < C and apple == r[0]:
		ans += r.popleft()
		r_cnt += 1
		loopcnt += 1
print(ans)


(x, y, a, b, c) = map(int, input().split())
p_l = sorted(list(map(int, input().split())), reverse=True)[:x]
q_l = sorted(list(map(int, input().split())), reverse=True)[:y]
r_l = list(map(int, input().split()))
p_l = sorted(p_l + q_l + r_l, reverse=True)
print(sum(p_l[:x + y]))


import heapq
(x, y, a, b, c) = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = list(map(lambda x: -int(x), input().split()))
heapq.heapify(r)
for i in range(x):
	heapq.heappush(r, -p[i])
for i in range(y):
	heapq.heappush(r, -q[i])
ans = 0
for i in range(x + y):
	ans -= heapq.heappop(r)
print(ans)


(x, y, a, b, c) = [int(x) for x in input().split()]
p = sorted([int(x) for x in input().split()], reverse=True)[:x]
q = sorted([int(x) for x in input().split()], reverse=True)[:y]
r = sorted([int(x) for x in input().split()])
print(sum(sorted(p + q + r, reverse=True)[:x + y]))


import heapq
(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()))
ans = 0
red_cnt = 0
green_cnt = 0
cnt = 0
heap = []
for i in range(len(p)):
	heapq.heappush(heap, (-p[i], 0))
for i in range(len(q)):
	heapq.heappush(heap, (-q[i], 1))
for i in range(len(r)):
	heapq.heappush(heap, (-r[i], 2))
while len(heap):
	(_x, _y) = heapq.heappop(heap)
	if _y == 0 and red_cnt < x:
		red_cnt += 1
		ans += _x
		cnt += 1
	elif _y == 1 and green_cnt < y:
		green_cnt += 1
		ans += _x
		cnt += 1
	elif _y == 2:
		cnt += 1
		ans += _x
	if cnt == x + y:
		print(-ans)
		return


(x, y, nr, ng, nm) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
m = list(map(int, input().split()))
r.sort(reverse=True)
g.sort(reverse=True)
a = r[:x] + g[:y] + m
a.sort(reverse=True)
print(sum(a[:x + y]))


(X, Y, A, B, C) = map(int, input().split())
plist = list(map(int, input().split()))
qlist = list(map(int, input().split()))
rlist = list(map(int, input().split()))
plist.sort()
qlist.sort()
rlist.sort()
plist = plist[::-1][:X]
qlist = qlist[::-1][:Y]
rlist = rlist[::-1]
pqrlist = plist + qlist + rlist
pqrlist.sort()
pqrlist = pqrlist[::-1]
print(sum(pqrlist[:X + Y]))


(X, Y, A, B, C) = list(map(int, input().split()))
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)
p_list = p[:X]
q_list = q[:Y]
mylist = sorted(p_list + q_list + r, reverse=True)
ans = 0
for i in range(X + Y):
	ans += mylist[i]
print(ans)


(x, y, a, b, c) = list(map(int, input().split()))
pA = list(map(lambda x: (int(x), 'a'), input().split()))
pB = list(map(lambda x: (int(x), 'b'), input().split()))
pC = list(map(lambda x: (int(x), 'c'), input().split()))
apples = sorted(pA + pB + pC)
cntA = 0
cntB = 0
cntC = 0
cnt = 0
while cntA + cntB + cntC < x + y:
	(val, col) = apples.pop()
	if col == 'a' and cntA < x:
		cntA += 1
		cnt += val
	elif col == 'b' and cntB < y:
		cntB += 1
		cnt += val
	elif col == 'c':
		cntC += 1
		cnt += val
print(cnt)


(X, Y, A, B, C) = map(int, input().split())
R = sorted(list(map(int, input().split())), reverse=True)
G = sorted(list(map(int, input().split())), reverse=True)
RG = sorted(list(map(int, input().split())), reverse=True)
d = R[:X] + G[:Y] + RG
d.sort(reverse=True)
print(sum(d[:X + Y]))


(x, y, a, b, c) = map(int, input().split())
r = sorted(list(map(int, input().split())), reverse=True)
g = sorted(list(map(int, input().split())), reverse=True)
w = list(map(int, input().split()))
p = sorted(r[:x] + g[:y] + w, reverse=True)
print(sum(p[:x + y]))


(x, y, a, b, c) = map(int, input().split())
p = sorted([int(x) for x in input().split()])[::-1][:x]
q = sorted([int(x) for x in input().split()])[::-1][:y]
r = [int(x) for x in input().split()]
row = sorted(p + q + r)[::-1]
print(sum(row[:x + y]))


(x, y, a, b, c) = map(int, input().split())
R = sorted(map(int, input().split()), reverse=True)
G = sorted(map(int, input().split()), reverse=True)
N = sorted(map(int, input().split()), reverse=True)
L = sorted(R[:x] + G[:y] + N[:x + y], reverse=True)
print(sum(L[:x + y]))


import sys
rl = lambda : list(map(int, input().split()))
(x, y, a, b, c) = rl()
p = rl()
q = rl()
r = rl()
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
res = sum(sorted(p[:x] + q[:y] + r, reverse=True)[:x + y])
print(res)


(X, Y, A, B, C) = list(map(int, input().split()))
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)
red = p[:X]
green = q[:Y]
red_no_eat = 0
green_no_eat = 0
for no in r:
	red_worst = red[-red_no_eat - 1] if red_no_eat < X else 10 ** 10
	green_worst = green[-green_no_eat - 1] if green_no_eat < Y else 10 ** 10
	if no > red_worst or no > green_worst:
		if red_worst < green_worst:
			red_no_eat += 1
		else:
			green_no_eat += 1
print(sum(p[:X - red_no_eat]) + sum(q[:Y - green_no_eat]) + sum(r[:red_no_eat + green_no_eat]))


(x, y, a, b, c) = [int(i) for i in input().split()]
red_list = [int(i) for i in input().split()]
green_list = [int(i) for i in input().split()]
non_col_list = [int(i) for i in input().split()]
red_list.sort()
green_list.sort()
non_col_list.sort()
eat_red = []
eat_green = []
for i in range(x):
	eat_red.append(red_list.pop())
for i in range(y):
	eat_green.append(green_list.pop())
ans_list = eat_green + eat_red + non_col_list
ans_list.sort()
ans = 0
for i in range(x + y):
	ans += ans_list.pop()
print(ans)


(x, y, a, b, c) = map(int, input().split())
taste = [sorted(list(map(int, input().split())), reverse=True) for i in range(3)]
red = taste[0][:x]
green = taste[1][:y]
noclo = taste[2]
print(sum(sorted(red + green + noclo)[-(x + y):]))


(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 = sorted(p, reverse=True)
q = sorted(q, reverse=True)
r = sorted(r)
box = []
ans = 0
for i in range(x):
	box.append(p[i])
for j in range(y):
	box.append(q[j])
box = box + r
box = sorted(box, reverse=True)
for k in range(x + y):
	ans += box[k]
print(ans)


(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=1)
q.sort(reverse=1)
r.sort(reverse=1)
m = p[:x] + q[:y] + r
m.sort(reverse=1)
print(sum(m[:x + y]))


import sys
sys.setrecursionlimit(10 ** 9)

def int1(x):
	return int(x) - 1

def II():
	return int(input())

def MI():
	return list(map(int, input().split()))

def MI1():
	return list(map(int1, input().split()))

def LI():
	return list(map(int, input().split()))

def LI1():
	return list(map(int1, input().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def MS():
	return input().split()

def LS():
	return list(input())

def LLS(rows_number):
	return [LS() for _ in range(rows_number)]

def printlist(lst, k=' '):
	print(k.join(list(map(str, lst))))
INF = float('inf')

def solve():
	(X, Y, A, B, C) = MI()
	L = []
	for r in LI():
		L.append((r, 'R'))
	for g in LI():
		L.append((g, 'G'))
	for t in LI():
		L.append((t, 'T'))
	L = sorted(L, reverse=True)
	ans = 0
	left = X + Y
	for (n, c) in L:
		if c == 'R':
			if X > 0:
				ans += n
				X -= 1
			else:
				continue
		elif c == 'G':
			if Y > 0:
				ans += n
				Y -= 1
			else:
				continue
		else:
			ans += n
		left -= 1
		if left == 0:
			print(ans)
			return

def __starting_point():
	solve()
__starting_point()


import sys
input = sys.stdin.readline
(X, Y, A, B, C) = map(int, input().split())
P = sorted(map(int, input().split()), reverse=True)
Q = sorted(map(int, input().split()), reverse=True)
R = list(map(int, input().split()))
C = P[:X] + Q[:Y] + R
C.sort(reverse=True)
print(sum(C[:X + Y]))


(x, y, a, b, c) = map(int, input().split())
print(sum(sorted(sorted(list(map(int, input().split())), reverse=True)[:x] + sorted(list(map(int, input().split())), reverse=True)[:y] + list(map(int, input().split())), reverse=True)[:x + y]))


(X, Y, A, B, C) = map(int, input().split())
l = list(map(int, input().split()))
m = list(map(int, input().split()))
n = list(map(int, input().split()))
l = sorted(l, reverse=True)[:X]
m = sorted(m, reverse=True)[:Y]
print(sum(sorted(l + m + n, reverse=True)[:X + Y]))


(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()))
s = sorted(p)[::-1][:X] + sorted(q)[::-1][:Y] + r
s = sorted(s)[::-1]
ans = sum(s[:X + Y])
print(ans)


import sys

def input():
	return sys.stdin.readline().rstrip()

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 = [10 ** 10] + p[:x]
	q = [10 ** 10] + q[:y]
	r += [0] * (a + b)
	ans = sum(p) + sum(q) - 2 * 10 ** 10
	(pcnt, qcnt) = (0, 0)
	for i in range(x + y):
		if p[-1 - pcnt] >= r[i] and q[-1 - qcnt] >= r[i]:
			break
		elif p[-1 - pcnt] > q[-1 - qcnt]:
			ans += -q[-1 - qcnt] + r[i]
			qcnt += 1
		else:
			ans += -p[-1 - pcnt] + r[i]
			pcnt += 1
	print(ans)

def __starting_point():
	main()
__starting_point()


(x, y, a, b, c) = list(map(int, input().split()))
p = [0] + list(map(int, input().split()))
q = [0] + list(map(int, input().split()))
r = [0] + list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
ans = 0
num = x + y
for _ in range(num):
	if x > 0 and y > 0:
		(i, j, k) = (p[-1], q[-1], r[-1])
		if i >= j and i >= k:
			ans += i
			p.pop()
			x -= 1
		elif j >= i and j >= k:
			ans += j
			q.pop()
			y -= 1
		else:
			ans += k
			r.pop()
	elif x > 0:
		(i, j) = (p[-1], r[-1])
		x -= 1
		if i >= j:
			ans += i
			p.pop()
		else:
			ans += j
			r.pop()
	elif y > 0:
		y -= 1
		(i, j) = (q[-1], r[-1])
		if i >= j:
			ans += i
			q.pop()
		else:
			ans += j
			r.pop()
print(ans)


(X, Y, A, B, C) = list(map(int, input().split()))
P = sorted(list(map(int, input().split())), reverse=True)
Q = sorted(list(map(int, input().split())), reverse=True)
R = sorted(list(map(int, input().split())), reverse=True)
pq = sorted(P[:X] + Q[:Y])
cnt = 0
for i in range(min(C, X + Y)):
	if R[i] <= pq[i]:
		break
	cnt += 1
ans = sum(pq[cnt:]) + sum(R[:cnt])
print(ans)


(x, y, a, b, c) = map(int, input().split())
p1 = list(map(int, input().split()))
p2 = list(map(int, input().split()))
p3 = list(map(int, input().split()))
p1.sort(reverse=True)
p2.sort(reverse=True)
ans = p1[:x] + p2[:y] + p3
ans.sort(reverse=True)
print(sum(ans[:x + y]))


(X, Y, A, B, C) = map(int, input().split())
P = sorted(map(int, input().split()), reverse=True)[:X]
Q = sorted(map(int, input().split()), reverse=True)[:Y]
R = sorted(map(int, input().split()), reverse=True)[:X + Y]
(i, j) = (X - 1, Y - 1)
for r in R:
	if i == -1 and j == -1:
		break
	elif j == -1:
		if r > P[i]:
			P[i] = r
			i -= 1
		else:
			break
	elif i == -1:
		if r > Q[j]:
			Q[j] = r
			j -= 1
		else:
			break
	elif P[i] > Q[j]:
		if r > Q[j]:
			Q[j] = r
			j -= 1
		else:
			break
	elif r > P[i]:
		P[i] = r
		i -= 1
	else:
		break
print(sum(P) + sum(Q))


(x, y, a, b, c) = map(int, input().split())
rs = [int(i) for i in input().split()]
gs = [int(i) for i in input().split()]
ws = [int(i) for i in input().split()]
rs.sort(reverse=True)
gs.sort(reverse=True)
ws.sort(reverse=True)
weight = 0
rs = rs[:x]
rs = [0] + rs
gs = gs[:y]
gs = [0] + gs
ws = [0] + ws
r = 0
g = 0
w = 0
while r + g + w < x + y:
	if r < x:
		w1 = weight + rs[r + 1]
	else:
		w1 = 0
	if g < y:
		w2 = weight + gs[g + 1]
	else:
		w2 = 0
	if w < c:
		w3 = weight + ws[w + 1]
	else:
		w3 = 0
	weight = max(w1, w2, w3)
	if weight == w1:
		r += 1
	elif weight == w2:
		g += 1
	elif weight == w3:
		w += 1
print(weight)


(X, Y, A, B, C) = map(int, input().split())
p_l = sorted(map(int, input().split()), reverse=True)
q_l = sorted(map(int, input().split()), reverse=True)
r_l = sorted(map(int, input().split()), reverse=True)
p = X
q = Y
r = 0
for i in range(min(X + Y, C)):
	if p == 0 and q == 0:
		break
	elif p == 0 and r_l[i] <= q_l[q - 1]:
		break
	elif q == 0 and r_l[i] <= p_l[p - 1]:
		break
	elif p == 0 and r_l[i] > q_l[q - 1]:
		(r, q) = (r + 1, q - 1)
	elif q == 0 and r_l[i] > p_l[p - 1]:
		(r, p) = (r + 1, p - 1)
	elif r_l[i] > q_l[q - 1] and p_l[p - 1] >= q_l[q - 1]:
		(r, q) = (r + 1, q - 1)
	elif r_l[i] > p_l[p - 1] and q_l[q - 1] >= p_l[p - 1]:
		(r, p) = (r + 1, p - 1)
	else:
		break
print(sum(p_l[:p]) + sum(q_l[:q]) + sum(r_l[:r]))


LMIIS = lambda : list(map(int, input().split()))
(X, Y, *e) = LMIIS()
P = LMIIS()
Q = LMIIS()
R = LMIIS()
P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)
print(sum(sorted(P[:X] + Q[:Y] + R, reverse=True)[:X + Y]))


(X, Y, A, B, C) = map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
T = list(map(int, input().split()))
R.sort(reverse=True)
G.sort(reverse=True)
R = R[:X]
G = G[:Y]
A = T + R + G
A.sort(reverse=True)
print(sum(A[:X + Y]))


(x, y, a, b, c) = map(int, input().split())
l = [list(map(int, input().split())) for i in range(3)]
k = sorted(l[0], reverse=True)[:x]
for i in sorted(l[1], reverse=True)[:y]:
	k.append(i)
for i in l[2]:
	k.append(i)
m = sorted(k, reverse=True)[:x + y]
print(sum(m))


(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)
p2 = p[:x]
q2 = q[:y]
l = p2 + q2 + r
l.sort(reverse=True)
ans = sum(l[:x + y])
print(ans)


(X, Y, A, B, C) = map(int, input().split())
r = sorted(list(map(int, input().split())), reverse=True)[:X]
g = sorted(list(map(int, input().split())), reverse=True)[:Y]
w = list(map(int, input().split()))
new = sorted(r + g + w, reverse=True)
print(sum(new[:X + Y]))


import heapq
(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()
s = p[:X] + q[:Y]
ans = sum(s)
heapq.heapify(s)
while r and s:
	if s[0] < r[-1]:
		ans += r[-1]
		r.pop()
		ans -= heapq.heappop(s)
	else:
		break
print(ans)


(x_aka, y_mid, 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_aka = sorted(p, reverse=True)
q_mid = sorted(q, reverse=True)
r_mu = sorted(r, reverse=True)
tmp = p_aka[:x_aka] + q_mid[:y_mid] + r_mu
sort_tmp = sorted(tmp, reverse=True)
print(sum(sort_tmp[:x_aka + y_mid]))


(X, Y, A, B, C) = map(int, input().split())
Ps = list(map(int, input().split()))
Qs = list(map(int, input().split()))
Rs = list(map(int, input().split()))
Ps.sort(reverse=True)
Qs.sort(reverse=True)
Al = Ps[:X] + Qs[:Y] + Rs
Al.sort(reverse=True)
print(sum(Al[:X + Y]))


(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()))
ps = sorted(p, reverse=True)
qs = sorted(q, reverse=True)
pn = ps[:x]
qn = qs[:y]
nl = sorted(pn + qn + r, reverse=True)
print(sum(nl[:x + y]))


(x, y, a, b, c) = map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
W = list(map(int, input().split()))
R.sort(reverse=True)
G.sort(reverse=True)
Z = W + R[0:x] + G[0:y]
Z.sort(reverse=True)
print(sum(Z[0:x + y]))


import sys
sys.setrecursionlimit(10 ** 9)

def int1(x):
	return int(x) - 1

def II():
	return int(input())

def MI():
	return list(map(int, input().split()))

def MI1():
	return list(map(int1, input().split()))

def LI():
	return list(map(int, input().split()))

def LI1():
	return list(map(int1, input().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def MS():
	return input().split()

def LS():
	return list(input())

def LLS(rows_number):
	return [LS() for _ in range(rows_number)]

def printlist(lst, k=' '):
	print(k.join(list(map(str, lst))))
INF = float('inf')

def solve():
	(X, Y, A, B, C) = MI()
	R = sorted(LI(), reverse=True)[:X]
	G = sorted(LI(), reverse=True)[:Y]
	T = LI()
	L = sorted(R + G + T, reverse=True)[:X + Y]
	print(sum(L))

def __starting_point():
	solve()
__starting_point()


(x, y, a, b, c) = map(int, input().split())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
A = A[::-1][:x]
B = B[::-1][:y]
C = C[::-1]
D = A + B + C
D.sort(reverse=True)
print(sum(D[:x + y]))


(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 = sorted(p, reverse=True)
q = sorted(q, reverse=True)
pq = sorted(p[:x] + q[:y])
r = sorted(r)
ans = 0
j = r.pop()
for i in pq:
	if i < j:
		ans += j
		j = 0
		if r:
			j = r.pop()
	else:
		ans += i
print(ans)


import heapq
from collections import deque
(must_red, must_green, a, b, c) = list(map(int, input().split()))
delicious_red_ls = list(map(int, input().split()))
delicious_green_ls = list(map(int, input().split()))
delicious_free_ls = list(map(int, input().split()))
delicious_red_ls.sort(reverse=True)
delicious_green_ls.sort(reverse=True)
first_red = delicious_red_ls[:must_red]
first_green = delicious_green_ls[:must_green]
first_set = first_green + first_red
first_set.sort()
delicious_free_ls.sort()
while delicious_free_ls:
	to_be_erased = heapq.heappop(first_set)
	erase = delicious_free_ls[-1]
	if to_be_erased < erase:
		new = delicious_free_ls.pop()
		heapq.heappush(first_set, new)
	else:
		heapq.heappush(first_set, to_be_erased)
		break
print(sum(first_set))


(x, y, a, b, c) = map(int, input().split())
p = sorted(list(map(int, input().split())))[::-1]
q = sorted(list(map(int, input().split())))[::-1]
r = sorted(list(map(int, input().split())))[::-1]
u = sorted(p[:x] + q[:y] + r)[::-1]
print(sum(u[:x + y]))


(X, Y, A, B, C) = map(int, input().split())
L = []
P = list(map(int, input().split()))
P.sort(reverse=True)
L += P[:X]
Q = list(map(int, input().split()))
Q.sort(reverse=True)
L += Q[:Y]
L += list(map(int, input().split()))
L.sort(reverse=True)
print(sum(L[:X + Y]))


(X, Y, A, B, C) = map(int, input().split())
p_list = list(map(int, input().split()))
q_list = list(map(int, input().split()))
r_list = list(map(int, input().split()))
p_list_max = sorted(p_list, reverse=True)
q_list_max = sorted(q_list, reverse=True)
r_list_max = sorted(r_list, reverse=True)
p_list_X = p_list_max[:X]
q_list_Y = q_list_max[:Y]
ans_list = []
ans_list.extend(p_list_X)
ans_list.extend(q_list_Y)
ans_list.extend(r_list_max)
ans_list_max = sorted(ans_list, reverse=True)
ans = 0
for i in range(X + Y):
	ans += ans_list_max[i]
print(ans)


(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()
p.reverse()
q.sort()
q.reverse()
new = p[0:X] + q[0:Y] + r
new.sort()
new.reverse()
print(sum(new[0:X + Y]))


L = lambda : map(int, input().split())
(x, y, a, b, c) = L()
(*p,) = L()
(*q,) = L()
(*r,) = L()
print(sum(sorted(sorted(p, reverse=1)[:x] + sorted(q, reverse=1)[:y] + r, reverse=1)[:x + y]))


(x, y, a, b, c) = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]
p = sorted(p)[::-1]
q = sorted(q)[::-1]
s = p[:x] + q[:y] + r[:]
s = sorted(s)[::-1]
ans = sum(s[:x + y])
print(ans)


(X, Y, A, B, C) = [int(n) for n in input().split(' ')]
p = [int(n) for n in input().split(' ')]
q = [int(n) for n in input().split(' ')]
r = [int(n) for n in input().split(' ')]
R = sorted(p)
G = sorted(q)
T = sorted(r)
W = 0
GetR = 0
GetG = 0
GetS = 0
while GetS < X + Y:
	a = -1
	b = -1
	c = -1
	if len(R) > 0 and GetR < X:
		a = R[-1]
	if len(G) > 0 and GetG < Y:
		b = G[-1]
	if len(T) > 0:
		c = T[-1]
	t = max([a, b, c])
	index = [a, b, c].index(t)
	W += t
	GetS += 1
	if index == 0:
		del R[-1]
		GetR += 1
	if index == 1:
		del G[-1]
		GetG += 1
	if index == 2:
		del T[-1]
print(W)


from collections import deque
(X, Y, A, B, C) = map(int, input().split())
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]
C = [int(c) for c in input().split()]
A = sorted(A, reverse=True)[:X]
B = sorted(B, reverse=True)[:Y]
AB = deque(sorted(A + B))
for c in sorted(C, reverse=True):
	if c >= AB[0]:
		AB.popleft()
		AB.append(c)
	else:
		break
print(sum(AB))


(X, Y, A, B, C) = map(int, input().split())
(p, q, r) = [list(map(int, input().split())) for _ in range(3)]
p = sorted(p, reverse=True)[:X]
q = sorted(q, reverse=True)[:Y]
l = p + q + r
l.sort(reverse=True)
print(sum(l[:X + Y]))


(x, y, a, b, c) = list(map(int, input().split()))
p = sorted(map(int, input().split()), reverse=True)
q = sorted(map(int, input().split()), reverse=True)
r = sorted(map(int, input().split()))
v = 0
c = sorted(p[0:x] + q[0:y])
for i in range(x + y):
	if len(r):
		if c[i] < r[-1]:
			c[i] = r.pop()
	else:
		break
print(sum(c))


(a, b, red, green, cl) = map(int, input().split())
r = sorted(list(map(int, input().split())))[::-1]
g = sorted(list(map(int, input().split())))[::-1]
c = sorted(list(map(int, input().split())))[::-1]
s = sorted(r[:a] + g[:b] + c)[::-1]
print(sum(s[:a + b]))


def main():
	(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()
	p = p[:X]
	q = q[:Y]
	s = p + q
	s.sort()
	rtmp = r.pop()
	for i in range(len(s)):
		if s[i] < rtmp:
			s[i] = rtmp
			if len(r) == 0:
				break
			rtmp = r.pop()
		else:
			break
	ans = sum(s)
	print(ans)

def __starting_point():
	main()
__starting_point()


def main():
	(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)
	ans = sum(sorted(P[:X] + Q[:Y] + R, reverse=True)[:X + Y])
	print(ans)

def __starting_point():
	main()
__starting_point()


(X, Y, *_) = map(int, input().split())
print(sum(sorted(sorted(map(int, input().split()), reverse=True)[:X] + sorted(map(int, input().split()), reverse=True)[:Y] + list(map(int, input().split())), reverse=True)[:X + Y]))


(x, y, a, b, c) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
cl = list(map(int, input().split()))
r.sort(reverse=True)
g.sort(reverse=True)
ans = r[:x] + g[:y] + cl
print(sum(sorted(ans, reverse=True)[:x + y]))


import sys
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7

def resolve():
	(X, Y, A, B, C) = list(map(int, input().split()))
	P = sorted(list(map(int, input().split())), reverse=True)[:X]
	Q = sorted(list(map(int, input().split())), reverse=True)[:Y]
	R = sorted(list(map(int, input().split())), reverse=True)
	L = sorted(P + Q + R, reverse=True)
	res = sum(L[:X + Y])
	print(res)

def __starting_point():
	resolve()
__starting_point()


import math
import sys
import collections
import bisect
readline = sys.stdin.readline

def main():
	(x, y, a, b, c) = list(map(int, input().split()))
	print(sum(sorted(sorted(list(map(int, input().split())), reverse=True)[0:x] + sorted(list(map(int, input().split())), reverse=True)[0:y] + sorted(list(map(int, input().split())), reverse=True), reverse=True)[0:x + y]))

def __starting_point():
	main()
__starting_point()


ni = lambda : int(input())
nm = lambda : map(int, input().split())
nl = lambda : list(map(int, input().split()))
(x, y, a, b, c) = nm()
ans = 0
p = sorted(nl())[::-1][:x]
q = sorted(nl())[::-1][:y]
r = sorted(nl())[::-1]
s = sorted(p + q + r)[::-1]
print(sum(s[:x + y]))