#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:67108864")
using namespace std;
const int N = 1507;
long long cmpx, cmpy;
struct Point {
  long long x, y;
  int index;
  bool operator<(const Point &o) const {
    return ((x - cmpx) * (o.y - cmpy) - (y - cmpy) * (o.x - cmpx) >= 0);
  }
};
int n, size[N], par[N], ans[N];
vector<int> G[N];
void dfs(int u) {
  size[u] = 1;
  for (int to : G[u]) {
    if (to != par[u]) {
      par[to] = u;
      dfs(to);
      size[u] += size[to];
    }
  }
}
bool cmp(const Point &A, const Point &B) { return A.y > B.y; }
void build(int v, vector<Point> pt) {
  if ((v != 1 && (int)(G[v]).size() == 1) || (v == 1 && n == 1)) {
    ans[pt[0].index] = v;
    return;
  }
  sort((pt).begin(), (pt).end(), cmp);
  cmpx = pt[0].x;
  cmpy = pt[0].y;
  ans[pt[0].index] = v;
  sort(pt.begin() + 1, pt.end());
  int p = 1;
  for (int to : G[v]) {
    if (to != par[v]) {
      int s = size[to];
      build(to, vector<Point>(pt.begin() + p, pt.begin() + p + s));
      p += s;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  vector<Point> pt(n);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d%I64d", &pt[i].x, &pt[i].y);
    pt[i].index = i;
  }
  dfs(1);
  build(1, pt);
  for (int i = 0; i < n; ++i) {
    printf("%d ", ans[i]);
  }
  return 0;
}
