loop {
    n = gets.to_i
    break if n == 0
    hand = [(1..n).map { gets.to_i }.sort]
    hand << (1..2*n).to_a - hand[-1]
    min = 0 
    i = 0 
    loop {
        x = hand[i].find{|y| y > min}
        if x 
            hand[i].delete(x)
            min = x
            break if hand[i].empty?
        else
            min = 0
        end 
        i = 1 - i
    }
    puts hand.map(&:size)
}