#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll> pql;
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, k, n) for(ll i = ll(k); i <= ll(n); i++)
#define rep3(i, n, k) for(ll i = ll(n); i >= ll(k); i--)
#define all(v) (v).begin(), (v).end()
ll mod(ll a, ll b) {if(b == 0) return 0; return (a % b + b) % b;}
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e3;
const ld eps = 1e-9;
const char newl = '\n';

vl parent(MAX), depth(MAX);
 
ll find(ll x) {if(parent[x]==x) return x; return parent[x] = find(parent[x]);}
 
void unite(ll x, ll y) {
  x = find(x);
  y = find(y);
  if (x==y) return;
  
  if(depth[x] < depth[y]) {
    parent[x] = y;
  }else {
    parent[y] = x;
    if(depth[x] == depth[y]) depth[x]++;
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  cout << fixed << setprecision(15);

  ll n;
  cin >> n;
  vl x(n), y(n);
  rep(i, n) cin >> x[i] >> y[i];

  ll ok=0, ng=40001;
  while(ng-ok>1) {
    ll RR = (ok+ng)/2;

    rep(i, n) {parent[i] = i; depth[i] = 0;}
    rep2(i, 200-99, 200+99) {parent[i] = 200; depth[i] = 0;}
    rep2(i, 400-99, 400+99) {parent[i] = 400; depth[i] = 0;}

    rep(i, n) {
      if((100+y[i])*(100+y[i]) < RR) unite(i, x[i]+200);
      if((100-y[i])*(100-y[i]) < RR) unite(i, x[i]+400);
    }

    rep(i, n-1) rep2(j, i+1, n-1) {
      ll dx = x[j]-x[i], dy = y[j]-y[i];
      if(dx*dx+dy*dy < RR) unite(i, j);
    }

    if(find(200)==find(400)) ng = (ok+ng)/2;
    else ok = (ok+ng)/2;
  }
  cout << sqrt(ok)/2 << newl;
  return 0;
}
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

vector<bool> seen;
vector<int> color;
vector<int> ans;
vector<int> c;
Graph G;

void dfs(const Graph &G, int v) {
    // cout << "v = " << v  << " " << color[c[v]] << endl;
    seen[v] = true;
    if (color[c[v]] == 0) ans.push_back(v+1);
    color[c[v]]++;
    // cout << "v = " << v  << " " << " c[v] = " << c[v] << " " << " color[v] = "  <<  color[c[v]] << endl;

    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue;
        dfs(G, next_v); // 再帰的に探索
    }
    color[c[v]]--;
}
int main(void) {
    int n;
    cin >> n;
    c.resize(n);
    rep(i, n) cin >> c[i];
    G.resize(n);
    rep(i, n-1) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    seen.assign(n, false);
    color.assign(100010, 0);
    dfs(G, 0);

    sort(ans.begin(), ans.end());
    rep(i, (int)ans.size()) {
        cout << ans[i] << endl;
    }
    return 0;
}