#include <bits/stdc++.h>
using namespace std;
typedef struct pt {
  int x, y, ind;
} pt;
int n, par[1510], ans[1510];
vector<int> adj[1510], cnt[1510];
pt pts[1510], lead;
int dfs(int u) {
  int t = 0;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == par[u]) continue;
    par[v] = u;
    int k = dfs(v);
    cnt[u][i] = k;
    t += k;
  }
  return t + 1;
}
bool cmp(pt a, pt b) {
  long long x1, y1, x2, y2;
  x1 = a.x - lead.x;
  y1 = a.y - lead.y;
  x2 = b.x - lead.x;
  y2 = b.y - lead.y;
  return (x1 * y2 - x2 * y1 < 0LL);
}
void solve(int v, int b, int e) {
  int last = b;
  ans[pts[b].ind] = v;
  if (b == e) return;
  lead = pts[b];
  sort(pts + b + 1, pts + e + 1, cmp);
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i], s = cnt[v][i];
    if (u == par[v]) continue;
    solve(u, last + 1, last + s);
    last = last + s;
  }
  return;
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    cnt[u].push_back(0);
    adj[v].push_back(u);
    cnt[v].push_back(0);
  }
  for (int i = 0; i < n; i++) {
    cin >> pts[i].x >> pts[i].y;
    pts[i].ind = i;
    if (i &&
        (pts[i].x < pts[0].x || (pts[i].x == pts[0].x && pts[i].y < pts[0].y)))
      swap(pts[0], pts[i]);
  }
  par[1] = -1;
  dfs(1);
  solve(1, 0, n - 1);
  for (int i = 0; i < n; i++) cout << (i ? " " : "") << ans[i];
  cout << endl;
  return 0;
}
