#include <bits/stdc++.h>
using namespace std;
const int M = 1505;
int n, asdf, head[M];
struct edge {
  int to, nxt;
} G[M * 2];
void add_edge(int a, int b) {
  G[++asdf].to = b;
  G[asdf].nxt = head[a];
  head[a] = asdf;
}
struct node {
  int x, y, id;
  double ji;
  bool operator<(const node &tmp) const {
    if (y == tmp.y) return x < tmp.x;
    return y < tmp.y;
  }
} A[M];
int sz[M], ans[M];
void dfs(int x, int f) {
  sz[x] = 1;
  for (int i = head[x]; i; i = G[i].nxt) {
    int y = G[i].to;
    if (y == f) continue;
    dfs(y, x);
    sz[x] += sz[y];
  }
}
bool cmp(node a, node b) { return a.ji < b.ji; }
void solve(int x, int f, int L, int R) {
  int t = -1;
  for (int i = L; i <= R; i++) {
    if (t == -1 || A[i] < A[t]) t = i;
  }
  ans[A[t].id] = x;
  swap(A[t], A[L]);
  for (int i = L + 1; i <= R; i++) {
    A[i].ji = atan2(A[i].y - A[L].y, A[i].x - A[L].x);
  }
  sort(A + L + 1, A + R + 1, cmp);
  int now = L + 1;
  for (int i = head[x]; i; i = G[i].nxt) {
    int y = G[i].to;
    if (y == f) continue;
    solve(y, x, now, now + sz[y] - 1);
    now += sz[y];
  }
}
int main() {
  int u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &u, &v);
    add_edge(u, v);
    add_edge(v, u);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &A[i].x, &A[i].y);
    A[i].id = i;
  }
  solve(1, 0, 1, n);
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
