Problem:
Score : 500 points

Problem Statement

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

1 2 2 2 1
2 4
5 1
3

Sample Output 1

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.

Sample Input 2

2 2 2 2 2
8 6
9 1
2 1

Sample Output 2

25

Sample Input 3

2 2 4 4 4
11 12 13 14
21 22 23 24
1 2 3 4

Sample Output 3

74

Solution in Fortran (gfortran v4.8.4) (judge verdict: Wrong Answer)

program main
    implicit none
    integer x, y, a, b, c
    integer i,j,k,l,n
    integer, allocatable, dimension(:) :: p, q, r
    integer, allocatable, dimension(:,:) :: t
    integer temp1, temp2
    integer sum, cx, cy ,random

    read(*,*) x, y, a, b, c
    allocate(p(a))
    allocate(q(b))
    allocate(r(c))
    read(*,*) p
    read(*,*) q
    read(*,*) r
    allocate(t(2,a+b+c))

    t = 0
    do i = 1,a
        t(1,i) = p(i)
        t(2,i) = 1
    end do

    do i = a+1,a+b
        t(1,i) = q(i-a)
        t(2,i) = 2
    end do

    do i = a+b+1,a+b+c
        t(1,i) = r(i-a-b)
        t(2,i) = 3
    end do

    n = a + b + c
    l = n/2 + 1
    k = n
    do while(k .ne. 1)
        if(l .gt. 1)then
            l = l - 1
            temp1 = t(1,l)
            temp2 = t(2,l)
        else
            temp1 = t(1,k)
            temp2 = t(2,k)
            t(1,k) = t(1,l)
            t(2,k) = t(2,l)
            k = k - 1
            if(k .eq. 1)then
                t(1,1)=temp1
                t(2,1)=temp2
                exit
            end if
        end if
        i = l
        j = l + l
        do while(j.le.k)
            if(j.lt.k)then
                if(t(1,j).lt.t(1,j+1)) then
                    j = j + 1
                end if
            end if
            if(temp1 .lt. t(1,j)) then
                t(1,i) = t(1,j)
                t(2,i) = t(2,j)
                i = j
                j = j+j
            else
                j=k+1
            end if
        end do
        t(1,i)=temp1
        t(2,i)=temp2
    end do


    sum = 0
    cx = 0
    cy = 0

    do i = a+b+c,1,-1
        if(t(2,i) == 1) then
            if (cx < x) then
                sum = sum + t(1,i)
                cx = cx + 1
            end if
        else if (t(2,i) == 2) then
            if (cy < y) then
                sum = sum + t(1,i)
                cy = cy + 1
            end if
        else if (t(2,i) == 3) then
            random = rand(0)
            if (random < 0.5) then
                if(cx < x) then
                    sum = sum + t(1,i)
                    cx = cx + 1
                else
                    sum = sum + t(1,i)
                    cy = cy + 1
                end if
            else
                if(cy < y) then
                    sum = sum + t(1,i)
                    cy = cy + 1
                else
                    sum = sum + t(1,i)
                    cx = cx + 1
                end if
            end if
        end if

        if(cx == x) then
            if(cy == y) then
                exit
            end if
        end if

    end do

    write(*,*) sum


end program