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, max

    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

    max = 0
    do j = 1,100
        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

        if(sum > max) then
            max = sum
        end if

    end do

    write(*,*) max


end program