#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1510;
struct point {
  int id, x, y;
} p0;
int N;
int idx[MAXN];
int sum[MAXN];
vector<int> adj[MAXN];
bool cmp(const point &a, const point &b) {
  return a.y == b.y ? a.x < b.x : a.y < b.y;
}
bool cmp2(const point &a, const point &b) {
  return (long long)(a.x - p0.x) * (b.y - p0.y) -
             (long long)(a.y - p0.y) * (b.x - p0.x) <
         0;
}
int dfs(int k, int pre) {
  sum[k] = 1;
  for (int i = 0; i < adj[k].size(); ++i) {
    if (adj[k][i] != pre) {
      sum[k] += dfs(adj[k][i], k);
    }
  }
  return sum[k];
}
void solve(int k, int pre, vector<point> p) {
  for (int i = 1; i < p.size(); ++i)
    if (cmp(p[i], p[0])) swap(p[i], p[0]);
  idx[p[0].id] = k;
  if (p.size() == 1) return;
  p0 = p[0];
  sort(p.begin() + 1, p.end(), cmp2);
  int ct = 0;
  for (int i = 0; i < adj[k].size(); ++i) {
    if (adj[k][i] == pre) continue;
    int n = sum[adj[k][i]];
    vector<point> v(n);
    for (int j = 0; j < n; ++j) {
      v[j] = p[++ct];
    }
    solve(adj[k][i], k, v);
  }
}
int main() {
  cin >> N;
  for (int i = 1; i < N; ++i) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<point> p(N);
  for (int i = 0; i < N; ++i) {
    cin >> p[i].x >> p[i].y;
    p[i].id = i;
  }
  dfs((N + 1) / 2, -1);
  solve((N + 1) / 2, -1, p);
  for (int i = 0; i < N; ++i) {
    cout << idx[i] << (i == N - 1 ? '\n' : ' ');
  }
  return 0;
}
