#include <bits/stdc++.h>
using namespace std;
int n;
int e[3100], pre[3100], last[3100], num, sz[3100];
int v[3100];
struct point {
  long long x, y;
  point(long long x = 0, long long y = 0) : x(x), y(y) {}
  int id;
} p[1600], s;
long long operator*(point a, point b) { return a.x * b.y - a.y * b.x; }
point operator-(point a, point b) { return point(a.x - b.x, a.y - b.y); }
bool operator<(point a, point b) { return (a - s) * (b - s) < 0; }
int cmp(point a, point b) {
  if (a.x != b.x) return a.x < b.x;
  return a.y < b.y;
}
void dfs(int x, int fa) {
  sz[x] = 1;
  for (int i = last[x]; i; i = pre[i])
    if (e[i] != fa) dfs(e[i], x), sz[x] += sz[e[i]];
}
void work(int x, int fa, int l, int r) {
  for (int i = l + 1; i <= r; i++)
    if (!cmp(p[l], p[i])) swap(p[i], p[l]);
  s = p[l];
  sort(p + l + 1, p + r + 1);
  v[p[l].id] = x;
  for (int i = last[x], sum = l; i; i = pre[i])
    if (e[i] != fa) work(e[i], x, sum + 1, sum + sz[e[i]]), sum += sz[e[i]];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    e[++num] = y, pre[num] = last[x], last[x] = num;
    e[++num] = x, pre[num] = last[y], last[y] = num;
  }
  for (int i = 1; i <= n; i++) cin >> p[i].x >> p[i].y, p[i].id = i;
  dfs(1, 0);
  work(1, 0, 1, n);
  for (int i = 1; i <= n; i++) {
    printf("%d", v[i]);
    if (i != n)
      printf(" ");
    else
      printf("\n");
  }
  return 0;
}
