#include <bits/stdc++.h>
using namespace std;
vector<int> E[100005];
int sz[100005];
void dfs(int x, int f) {
  sz[x] = 1;
  for (int i = 0; i < (int)E[x].size(); i++) {
    int y = E[x][i];
    if (y == f) continue;
    dfs(y, x);
    sz[x] += sz[y];
  }
}
struct Point {
  int x, y, id;
} A[100005];
Point C;
bool cmp(Point a, Point b) {
  return 1ll * (a.y - C.y) * (b.x - C.x) < 1ll * (a.x - C.x) * (b.y - C.y);
}
bool cmp1(Point a, Point b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
int Ans[100005];
void solve(int x, int f, int l, int r) {
  sort(A + l, A + r + 1, cmp1);
  C = A[l], Ans[A[l].id] = x;
  sort(A + l + 1, A + r + 1, cmp);
  int base = l + 1;
  for (int i = 0; i < (int)E[x].size(); i++) {
    int y = E[x][i];
    if (y == f) continue;
    solve(y, x, base, base + sz[y] - 1);
    base = base + sz[y];
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (2), i_END = (n); i <= i_END; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    E[x].push_back(y);
    E[y].push_back(x);
  }
  dfs(1, 0);
  for (int i = (1), i_END = (n); i <= i_END; i++)
    scanf("%d%d", &A[i].x, &A[i].y), A[i].id = i;
  solve(1, 0, 1, n);
  for (int i = (1), i_END = (n); i <= i_END; i++) printf("%d ", Ans[i]);
  puts("");
  return 0;
}
