import scala.io.StdIn.readInt

object Main extends App {
  Iterator.continually(readInt).takeWhile(_!=0).foreach { n=>
    val total = (1 to 2*n).toList
    val taro = { for(i<-0 until n) yield readInt }.toList.sorted
    val hanako = (total filterNot taro.toSet).sorted
    def play(t:List[Int],h:List[Int],x:Int,turn:Int):(Int,Int) = {
      if(h.length==0 || t.length==0) (h.length,t.length)
      else if(turn%2 == 0) {
        if(t.exists(_ > x)) {
          val y = t.find(_>x).get
          play(t.filter(_!=y),h,y,turn+1)
        } else play(t,h,0,turn+1)
      } else {
        if(h.exists(_ > x)) {
          val y = h.find(_>x).get
          play(t,h.filter(_!=y),y,turn+1)
        } else play(t,h,0,turn+1)
      }
    }
    val (t,h) = play(taro,hanako,0,0)
    println(t)
    println(h)
  }
}