#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3fffffff;
const long long mod = 1000000007;
const int maxn = 1500 + 100;
int head[maxn];
struct node {
  int x, y, ans, id;
} a[maxn];
struct edge {
  int to, next;
} e[maxn * 2];
int tol = 0;
void add(int u, int v) {
  e[++tol].to = v, e[tol].next = head[u], head[u] = tol;
}
int sz[maxn];
void dfs(int u, int f) {
  sz[u] = 1;
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].to;
    if (v == f) continue;
    dfs(v, u);
    sz[u] += sz[v];
  }
}
int x, y;
bool cmp(node a, node b) {
  return 1ll * (a.y - y) * (b.x - x) < 1ll * (b.y - y) * (a.x - x);
}
bool cmp1(node a, node b) { return a.id < b.id; }
int vis[maxn];
void dfs1(int u, int l, int r) {
  int x1 = inf, y1 = inf;
  int p = -1;
  vis[u] = 1;
  if (l == r) {
    a[l].ans = u;
    return;
  }
  for (int i = l; i < r + 1; i++) {
    if (a[i].x < x1)
      x1 = a[i].x, y1 = a[i].y, p = i;
    else if (a[i].x == x1 && a[i].y < y1)
      y1 = a[i].y, p = i;
  }
  x = x1, y = y1;
  swap(a[p], a[l]);
  a[l].ans = u;
  sort(a + l + 1, a + r + 1, cmp);
  int t = l + 1;
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].to;
    if (vis[v]) continue;
    dfs1(v, t, t + sz[v] - 1);
    t = t + sz[v];
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v), add(v, u);
  }
  for (int i = 1; i < n + 1; i++) {
    scanf("%d%d", &a[i].x, &a[i].y);
    a[i].id = i;
  }
  dfs(1, 0);
  memset(vis, 0, sizeof(vis));
  dfs1(1, 1, n);
  sort(a + 1, a + n + 1, cmp1);
  for (int i = 1; i < n + 1; i++) printf("%d ", a[i].ans);
  puts("");
  return 0;
}
