Digital tournament
Your friend F. was given a set consisting of positive integers as a gift. Considering the fact that your friend F. often takes part in football tournaments, he decided to organize a tournament for his positive integers.
The numbers from the tournament are depicted below. The tournament takes place in pairs, where the higher of two numbers advances to the upper level. The levels are denoted with numbers from to , where the highest level is given with the number .
Since your friend F. doesn’t have time to organize all tournaments, he wants to know, for each number from the initial set, the highest level (the smallest level number) at which the number can end up in, for any permutation of the input array.
Input
The first line contains the positive integer .
The following line contains positive integers from the interval , the elements of the set.
Output
Print in one line numbers, the labels of the highest level (the smallest level labels) at which a number can end up in, in the order the numbers were given in the input.