#include <bits/stdc++.h>
using namespace std;
int n, sz[1509], ans[1509];
vector<int> v[1509];
vector<pair<pair<long long, long long>, int> > p;
pair<long long, long long> r;
bool sortt(pair<pair<long long, long long>, int> a,
           pair<pair<long long, long long>, int> b) {
  pair<long long, long long> x = a.first, y = b.first;
  x.first -= r.first, x.second -= r.second;
  y.first -= r.first, y.second -= r.second;
  return (x.first * y.second - x.second * y.first) > 0;
}
void dfs(int node, int p) {
  sz[node] = 1;
  for (auto i : v[node])
    if (i != p) {
      dfs(i, node);
      sz[node] += sz[i];
    }
}
void solve(int node, int par, int s, int e) {
  ans[p[s].second] = node;
  r = p[s].first;
  sort(p.begin() + s + 1, p.begin() + e, sortt);
  int cnt = 1;
  for (auto i : v[node])
    if (i != par) {
      solve(i, node, s + cnt, s + cnt + sz[i]);
      cnt += sz[i];
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y), v[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    p.push_back({{x, y}, i});
  }
  dfs(1, 0);
  sort(p.begin(), p.end(),
       [&](pair<pair<long long, long long>, int> x,
           pair<pair<long long, long long>, int> y) {
         return make_pair(x.first.second, x.first.first) <
                make_pair(y.first.second, y.first.first);
       });
  solve(1, 0, 0, n);
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
}
