#arc095a. [arc095_a]Many Medians

[arc095_a]Many Medians

Problem Statement

When ll is an odd number, the median of ll numbers a1,a2,...,ala_1, a_2, ..., a_l is the (fracl+12)(\\frac{l+1}{2})-th largest value among a1,a2,...,ala_1, a_2, ..., a_l.

You are given NN numbers X1,X2,...,XNX_1, X_2, ..., X_N, where NN is an even number. For each i=1,2,...,Ni = 1, 2, ..., N, let the median of X1,X2,...,XNX_1, X_2, ..., X_N excluding XiX_i, that is, the median of X1,X2,...,Xi1,Xi+1,...,XNX_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be BiB_i.

Find BiB_i for each i=1,2,...,Ni = 1, 2, ..., N.

Constraints

  • 2leqNleq2000002 \\leq N \\leq 200000
  • NN is even.
  • 1leqXileq1091 \\leq X_i \\leq 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN X1X_1 X2X_2 ... XNX_N

Output

Print NN lines. The ii-th line should contain BiB_i.


Sample Input 1

4
2 4 4 3

Sample Output 1

4
3
3
4
  • Since the median of X2,X3,X4X_2, X_3, X_4 is 44, B1=4B_1 = 4.
  • Since the median of X1,X3,X4X_1, X_3, X_4 is 33, B2=3B_2 = 3.
  • Since the median of X1,X2,X4X_1, X_2, X_4 is 33, B3=3B_3 = 3.
  • Since the median of X1,X2,X3X_1, X_2, X_3 is 44, B4=4B_4 = 4.

Sample Input 2

2
1 2

Sample Output 2

2
1

Sample Input 3

6
5 5 4 4 3 3

Sample Output 3

4
4
4
4
4
4