output_description: Print N lines. The i-th line should contain B_i.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      X_1 X_2 ... X_N
attempt: #include <bits/stdc++.h>
  using namespace std;
  
  using ll = long long;
  #define countof(a) (sizeof(a)/sizeof((a)[0]))
  #define rep(i, n) for(int i = 0; i < (n); i++)
  #define rep1(i, n) for(int i = 1; i < (n); i++)
  #define all(a) begin(a),end(a)
  template<class T> istream& operator >> (istream& s, vector<T>& v)
  { for (T& x: v) { s >> x; } return s;}
  template<class T> void cout_v(const vector<T>& c)
  { for (int i = 0; i < c.size(); i++) cout << c[i] << endl; }
  template<class T> void cout_h(const vector<T>& c)
  { for (int i = 0; i < c.size(); i++) cout << c[i] << (i==c.size()-1?"\n":" "); }
  #define SP << " " <<
  #define FMT(a) #a<<":"<<a 
  #define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
  #define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
  #define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 
  
  signed main()
  {
      cin.tie(0); ios::sync_with_stdio(false);
      //cout<<std::fixed<<std::setprecision(10);
  
      int N; cin >>N;
      vector<int> X(N); cin >> X;
      vector<int> Xs(X);
      
      sort(all(Xs));
  
      int lhs = Xs[N/2-1], rhs = Xs[N/2];
  
      rep(i, N) {
          if (X[i] <= lhs) {
              cout << rhs << endl;
          } else {
              cout << lhs << endl;
          } 
      }
  }
  
problem_description: Statement
  
  When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the
  (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.
  
  You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For
  each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i,
  that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.
  
  Find B_i for each i = 1, 2, ..., N.
samples: [{"input": "4\n    2 4 4 3", "output": "4\n    3\n    3\n    4\n    \n\n  * Since the median of X_2, X_3, X_4 is 4, B_1 = 4.\n  * Since the median of X_1, X_3, X_4 is 3, B_2 = 3.\n  * Since the median of X_1, X_2, X_4 is 3, B_3 = 3.\n  * Since the median of X_1, X_2, X_3 is 4, B_4 = 4.\n\n* * *"}, {"input": "2\n    1 2", "output": "2\n    1\n    \n\n* * *"}, {"input": "6\n    5 5 4 4 3 3", "output": "4\n    4\n    4\n    4\n    4\n    4"}]