let split_string ?(pattern=" ") = Str.split @@ Str.regexp pattern

let (x, y, a, b, c) = Scanf.sscanf (read_line ()) "%d %d %d %d %d" @@ fun x y a b c -> (x, y, a, b, c)
let p = Array.of_list @@ List.map int_of_string @@ split_string @@ read_line ()
let q = Array.of_list @@ List.map int_of_string @@ split_string @@ read_line ()
let r = List.map int_of_string @@ split_string @@ read_line ()

let rec loop arr i acc = 
  if List.length acc = 0 || (x + y) = i then
    Printf.printf "%d\n" @@ Array.fold_left (+) 0 arr
  else
    match acc with
      | [] -> loop arr c []
      | x :: xs ->
          let next = ref i in
          while !next < (x + y) && x < arr.(!next) do next := !next + 1 done;
          if !next < (x + y) then arr.(!next) <- x;
          loop arr (!next + 1) xs

let rev a b = b - a          

let () =
  Array.sort rev p;
  Array.sort rev q;
  let t = Array.append (Array.sub p 0 x) (Array.sub q 0 y) in
  Array.sort rev t;
  Array.sort rev q;
  loop t 0 r