def can_put(nowCard, hanakoCard, taroCard, turn)
  if turn == "taro"
    if nowCard < hanakoCard.max
      turn = "hanako"
      i = hanakoCard.index{|m| nowCard < m}
      nowCard = hanakoCard[i]
      hanakoCard.delete(nowCard)
    else nowCard > hanakoCard.max
      nowCard = taroCard.shift 
    end
  else turn == "hanako"
    if nowCard < taroCard.max
      turn = "taro"
      i = taroCard.index{|m| nowCard < m}
      nowCard = taroCard[i]
      taroCard.delete(nowCard)
    else nowCard > taroCard.max
      nowCard = hanakoCard.shift  
    end
  end
  return nowCard, hanakoCard, taroCard, turn
end

loop do
  n = gets.chomp.to_i
  break if n == 0
  allCard = []
  (1..2*n).each do |i|
    allCard << i
  end
  taroCard = []
  hanakoCard = []
  n.times do |num|
    taroCard << gets.chomp.to_i
  end
  taroCard = taroCard.sort{|a,b| a<=>b}
  hanakoCard = allCard.reject{|val| taroCard.include?(val)}.sort{|a,b| a<=>b} 
  nowCard = taroCard.shift

  turn = "taro"
  loop do
    break if taroCard.length == 0 || hanakoCard.length == 0
    nowCard, hanakoCard, taroCard, turn = can_put(nowCard, hanakoCard, taroCard, turn)
  end

  puts hanakoCard.length
  puts taroCard.length
end

