#include<bits/stdc++.h>
typedef double          D;
typedef long long int   LL;
typedef long double     LD;
#define OR              ||
#define AND             &&
#define nl              '\n'
#define S               string
#define inf             INT_MAX
#define SQR(a)          (a) * (a)
#define pb              push_back
#define GCD(a, b)       __gcd(a, b)
#define PI              2.0*acos(0.0)
#define pii             pair<int,int>
#define pll             pair<long long,long long>
#define LCM(a, b)       (a * b) / GCD(a, b)
#define mem(a,b)        memset(a,b,sizeof(a))
#define srtv(v)         sort(v.begin(),v.end())
//#define T               int t; cin>>t; while(t--)
#define Rep(i,a,b)      for(int i = a; i <= b; i++)
#define rep(i,a,b)      for(int i = a; i >= b; i--)
#define boost           ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inout           freopen("input.txt","r",stdin);freopen("output.txt","w",stdout)

#define si(x)           scanf("%d",&x)
#define pi(x)           printf("%d",x)
#define ss(str)         scanf("%s",str)
#define pl(x)           printf("%lld",x)
#define sl(x)           scanf("%lld",&x)
#define sii(x,y)        scanf("%d %d",&x,&y)
#define sll(x,y)        scanf("%lld %lld",&x,&y)
#define siii(x,y,z)     scanf("%d %d %d",&x,&y,&z)
#define slll(x,y,z)     scanf("%lld %lld %lld",&x,&y,&z)
using namespace std;

/*
int bs(int l,int r,int n)
{
    int mid,res=inf;

    while(l<=r)
    {
        mid=l+(r-l)/2;

        if(check(mid,n))
        {
            r=mid-1;
            res=min(res,mid);
        }
        else
            l=mid+1;

    }

    return res;
}
*/


//--------------------------code starts here---------------------------------------
const int mx=100005;
vector<int> adj[mx];
bool vis[mx];
int clr[mx];
int now[mx];
bool isGood[mx];

void dfs(int u)
{
    vis[u]=true;
    now[clr[u]]++;
    if(now[clr[u]]==1)
        isGood[u]=true;
    for(int i=0;i<adj[u].size();i++)
    {
        if(!vis[adj[u][i]])
        {
            //now[clr[u]]++;
            dfs(adj[u][i]);
            //now[clr[u]]--;
        }

    }
    now[clr[u]]--;
}


int main()
{
    int n;
    si(n);

    Rep(i,1,n)
    {
        si(clr[i]);
    }
    int u,v;
    Rep(i,1,n-1)
    {
        sii(u,v);
        adj[u].pb(v);
        adj[v].pb(u);
    }

    dfs(1);

    Rep(i,1,n)
    {
        if(isGood[i])
        {
            printf("%d\n",i);
        }
    }



    return 0;
}

#include <bits/stdc++.h> 
using namespace std;
std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now();
//*******************************************Defines***************************************************************************
#define all(x) (x).begin(),(x).end()                    
#define sort(x) sort(x.begin(),x.end())
#define maxin(x) *max_element(x.begin(),x.end())        
#define minin(x) *min_element(x.begin(),x.end())
#define lint long long int                              
#define nl '\n'
#define INF (lint)1e18
#define EPS (double)1/(INF)
//#define MOD (lint)998244353
#define MOD (lint)(1e9+7)
#define debug(x) cout<<#x<<"\t=\t"<<(x)<<"\n"
// ********************************************** Templates********************************************************************
template <typename T> inline T powmod(T a, T b){ if(b==0) return 1; T half = powmod(a,b/2); return (((half*half)%MOD)*(b%2?a:1))%MOD;}
template <typename T> inline T gcd(T a, T b) { while (b != 0) swap(b, a %= b); return a;} 
template <typename T> inline T lcm(T a, T b) { return ((a/gcd(a,b))*b);}
template <typename T> inline T raise_pow(T base, T exp){
        if(exp==0) return (T)1;
        T half = raise_pow(base,exp/2);
        if(exp%2) return (half*half*base);
        return half*half;
}
template <typename T> inline T max_pow(T base, T exp){
        if(base<exp) return 0;
        return 1+max_pow(base/exp,exp);
}
void solve(){
        int n;
        cin>>n;
        vector<lint> arr(n);
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        sort(arr);
        
        int r = (n/2);
        long double ans = 0;
        
        for(int i=0;i<n;i++){
            if(i+1>=r+1) 
                ans+=arr[i];
            if(i+1==r+1 && n%2==1) 
                ans=ans-((long double)arr[i])/2;
        }
        cout<<setprecision(25)<<ans/n;
}
int main()
{       ios_base::sync_with_stdio(0);cin.tie(0);lint testnum=1,totalnum=1;
        //cin>>totalnum;
        for(testnum=1;testnum<=totalnum;++testnum){
                //cout<<"Case #"<<testnum<<": ";
                solve();
                cout<<nl;
        }
        bool time=false;
        //time=true;
        if(time){
                std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now();
                std::chrono::duration<double> time_taken = std::chrono::duration_cast<std::chrono::duration<double>>(end_time - start_time);
                cout << "\nTime Taken: " <<setprecision(10)<<time_taken.count() << " s";
        }
return 0;}

/*
    created on: 12.06.2021

*/
                      

