#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
//cout << fixed << setprecision(8) << a << endl;
//cout << "Case " << ca << ": " << ans << endl;
#define Fast_Input ios_base :: sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
int visited[200005];
int main ()
{
    int n,i,j,z,c,s=0;
    cin >> n;
    z=n/2;
    vector < long long int > m;
    vector < long long int > v;
    vector < long long int > p;
    for(i=1;i<=n;i++)
    {
        long long int x;
        cin >> x;
        m.push_back(x);
        v.push_back(x);
    }

    sort(v.begin(),v.end());

    for(i=0;i<n;i++)
    {
        long long int y;
        y=m[i];

        if(visited[y]==0)
        {
            c=0;
            s=0;
            for(j=0;c!=z;j++)
            {
                if(v[j]==y)
                    s++;
                if(s!=1)
                {
                    c++;
                    if(c==z)
                        {
                            p.push_back(v[j]);
                            visited[y]=v[j];
                        }
                }
            }
        }

        else
            p.push_back(visited[y]);

    }

    for(i=0;i<n;i++)
    {
        cout << p[i] << endl;
    }

    return 0;
}
