#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000;
pair<int, int> o;
inline bool left_turn(const pair<int, int> &a, const pair<int, int> &b,
                      const pair<int, int> &c) {
  return 1LL * (b.first - a.first) * (c.second - b.second) -
             1LL * (b.second - a.second) * (c.first - b.first) >
         0;
}
inline bool cmp(pair<int, int> a, pair<int, int> b) {
  return left_turn(o, a, b);
}
int n;
vector<int> adj[MAXN];
map<pair<int, int>, int> num;
int res[MAXN], child[MAXN];
int dfs(int pos, int par) {
  int tot = 1;
  for (__typeof((adj[pos]).begin()) it = (adj[pos]).begin();
       it != (adj[pos]).end(); ++it)
    if (*it != par) tot += dfs(*it, pos);
  return child[pos] = tot;
}
void go(int pos, vector<pair<int, int> > V, int par) {
  sort((V).begin(), (V).end());
  pair<int, int> tmp = V[0];
  V.erase(V.begin());
  o = tmp;
  res[num[tmp]] = pos;
  sort((V).begin(), (V).end(), cmp);
  int p = 0;
  for (__typeof((adj[pos]).begin()) it = (adj[pos]).begin();
       it != (adj[pos]).end(); ++it)
    if (*it != par) {
      vector<pair<int, int> > next;
      for (register int rep = (0); rep < (int)(child[*it]); ++rep)
        next.push_back(V[p++]);
      go(*it, next, pos);
    }
}
int main() {
  cin >> n;
  for (register int i = (1); i < (int)(n); ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<pair<int, int> > inp;
  for (register int i = (0); i < (int)(n); ++i) {
    int x, y;
    cin >> x >> y;
    num[pair<int, int>(x, y)] = i;
    inp.push_back(pair<int, int>(x, y));
  }
  dfs(0, -1);
  go(0, inp, -1);
  for (register int i = (0); i < (int)(n); ++i) cout << res[i] + 1 << " ";
  cout << endl;
  return 0;
}
