#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
struct Point {
  long long x, y;
  int id;
  Point() {}
  Point(long long _x, long long _y) { x = _x, y = _y; }
} now, p[3000];
Point operator-(Point a, Point b) { return Point(a.x - b.x, a.y - b.y); }
double Cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
int book[3000], ans[3000], n, sz[3000];
vector<int> g[3000];
bool cmp(Point a, Point b) { return Cross(a - now, b - now) > 0; }
void dfs(int x, int fa) {
  sz[x] = 1;
  for (int i = 0, v; i < g[x].size(); i++)
    if ((v = g[x][i]) != fa) dfs(v, x), sz[x] += sz[v];
}
void solve(int x, int l, int r) {
  book[x] = 1;
  for (int i = l + 1; i <= r; i++)
    if (p[i].y < p[l].y || (p[i].y == p[l].y && p[i].x < p[l].x))
      swap(p[i], p[l]);
  ans[p[l].id] = x;
  now = p[l];
  sort(p + l + 1, p + r + 1, cmp);
  for (int i = 0, v; i < g[x].size(); i++) {
    if (book[v = g[x][i]]) continue;
    solve(v, l + 1, l + sz[v]);
    l += sz[v];
  }
}
int main() {
  cin >> n;
  for (int i = 1, u, v; i < n; i++)
    scanf("%d%d", &u, &v), g[u].push_back(v), g[v].push_back(u);
  dfs(1, -1);
  for (int i = 1; i <= n; i++) scanf("%lld%lld", &p[i].x, &p[i].y), p[i].id = i;
  solve(1, 1, n);
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
