#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1, c = getchar();
  while (c < 48) c == '-' && (f = -1), c = getchar();
  while (c > 47) x = x * 10 + c - '0', c = getchar();
  return x * f;
}
const int MAXN = 2005;
struct Point {
  long long x, y, id;
} p[MAXN], tmp;
std::vector<int> G[MAXN];
long long size[MAXN], ans[MAXN];
long long n;
inline void addedge(int u, int v) {
  G[u].push_back(v);
  G[v].push_back(u);
}
inline bool cmp(Point a, Point b) {
  long long ax = a.x - tmp.x, ay = a.y - tmp.y;
  long long bx = b.x - tmp.x, by = b.y - tmp.y;
  if (ax >= 0 && bx <= 0) return 1;
  if (ax <= 0 && bx >= 0) return 0;
  return ax * by > ay * bx;
}
void dfs(int x, int fa) {
  size[x] = 1;
  for (int &y : G[x]) {
    if (y == fa) continue;
    dfs(y, x);
    size[x] += size[y];
  }
}
void sol(long long l, long long r, long long x, long long fa) {
  long long cur = l;
  for (long long i = l + 1; i <= r; i++)
    if (p[i].x < p[cur].x || (p[i].x == p[cur].x && p[i].y < p[cur].y)) cur = i;
  swap(p[l], p[cur]);
  tmp = p[l];
  ans[p[l].id] = x;
  sort(p + l + 1, p + r + 1, cmp);
  long long now = l + 1;
  for (int &y : G[x]) {
    if (y == fa) continue;
    sol(now, now + size[y] - 1, y, x);
    now += size[y];
  }
}
int main(int argc, char const *argv[]) {
  n = read();
  for (int i = 1; i < n; ++i) addedge(read(), read());
  long long x, y, w;
  for (int i = 1; i <= n; ++i) {
    x = read();
    y = read();
    p[i] = (Point){x, y, i};
  }
  dfs(1, 0);
  sol(1, n, 1, 0);
  for (long long i = 1; i <= n; i++) printf("%lld%c", ans[i], " \n"[i == n]);
  return 0;
}
