#include <bits/stdc++.h>
using namespace std;
struct point {
  double x, y, alpha;
  int num;
};
int n, c[1510] = {}, ans[1510] = {};
vector<int> a[1510];
point p[1510];
int rec(int v, int pr) {
  int r = 0;
  for (int i = 0; i < a[v].size(); i++)
    if (a[v][i] != pr) r += rec(a[v][i], v);
  return (c[v] = r) + 1;
}
bool comp(point p1, point p2) { return (p1.alpha < p2.alpha); }
int rec2(int v, int t, int pr) {
  int s = t;
  for (int i = t + 1; i <= t + c[v]; i++)
    if (p[i].x < p[s].x || (p[i].x == p[s].x && p[i].y < p[s].y)) s = i;
  swap(p[s], p[t]);
  for (int i = t + 1; i <= t + c[v]; i++)
    if (p[i].x != p[t].x)
      p[i].alpha = atan((p[i].y - p[t].y) / (p[i].x - p[t].x));
    else if (p[i].y > p[t].y)
      p[i].alpha = 3.1415926536 / 2;
    else
      p[i].alpha = -3.1415926536 / 2;
  sort(p + t + 1, p + t + c[v] + 1, comp);
  ans[p[t++].num] = v;
  for (int i = 0; i < a[v].size(); i++)
    if (a[v][i] != pr) t += rec2(a[v][i], t, v);
  return c[v] + 1;
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    cin >> p[i].x >> p[i].y;
    p[i].num = i;
  }
  rec(0, -1);
  rec2(0, 0, -1);
  for (int i = 0; i < n; i++) cout << ans[i] + 1 << " ";
}
