#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+1e4;
ll n;
ll a[N];
signed main()
{
cin>>n;
while(n!=0)
{
for(ll i=1;i<=n;i++)cin>>a[i];
sort(a+1,a+n+1);
if(n%2==0)cout<<(a[n/2]+a[n/2+1])/2;//c++自带ll向下取整
else cout<<a[n/2+1];
cout<<"\n";
cin>>n;
}
}