object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val ls = in.map(_.split(' ').map(_.toInt))
  val X = ls(0)(0)
  val Y = ls(0)(1)  
  var p = ls(1).toSeq.sorted.reverse.take(X)
  var q = ls(2).toSeq.sorted.reverse.take(Y)
  var r = ls(3).toSeq.sorted.reverse
  
  val all = (p ++ q ++ r).sorted.reverse.take(X+Y)
  val ret = all.sum
  println(ret)
}
