let () = Scanf.scanf "%d %d %d %d %d\n" @@ fun x y a b c ->
  let ps = Array.init a @@ fun _ -> Scanf.scanf "%d " @@ fun p -> p in
  let qs = Array.init b @@ fun _ -> Scanf.scanf "%d " @@ fun q -> q in
  let rs = Array.init c @@ fun _ -> Scanf.scanf "%d " @@ fun r -> r in
  Array.sort (fun p p' -> compare p' p) ps;
  Array.sort (fun q q' -> compare q' q) qs;
  Array.sort (fun r r' -> compare r' r) rs;
  Printf.printf "%d\n" @@
  Array.fold_left ( + ) 0 @@
  Array.sub
    ( Array.of_list @@
      List.merge (fun m n -> compare n m) (Array.to_list (Array.sub ps 0 x)) @@
      List.merge (fun m n -> compare n m) (Array.to_list (Array.sub qs 0 y)) @@
      Array.to_list rs ) 0 (x + y)