#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1500;
struct pnt {
  int x, y, ord, vw;
};
struct angdls {
  pnt ref;
  angdls(pnt a) { ref = a; };
  bool operator()(pnt p1, pnt p2) {
    return 1ll * (p1.x - ref.x) * (p2.y - ref.y) >
           1ll * (p2.x - ref.x) * (p1.y - ref.y);
  }
};
struct yls {
  bool operator()(pnt p1, pnt p2) {
    if (p1.y == p2.y) return p1.x < p2.x;
    return p1.y < p2.y;
  }
} yl;
struct ordls {
  bool operator()(pnt p1, pnt p2) { return p1.ord < p2.ord; }
} ordl;
int N;
vector<pair<int, int> > edg(MAXN - 1);
vector<pnt> pts(MAXN);
vector<int> dpt(MAXN + 1);
bool vtd[MAXN + 1];
int dfs_size(int n) {
  dpt[n] = 0;
  for (int i = 0; i < N - 1; i++) {
    if (edg[i].first == n || edg[i].second == n) {
      int nv = (edg[i].first == n) ? edg[i].second : edg[i].first;
      if (dpt[nv] + 1) continue;
      dpt[n] += dfs_size(nv);
    }
  }
  return ++dpt[n];
}
void rec_mark(int cn, int spt, int npt) {
  vtd[cn] = true;
  pts[spt].vw = cn;
  if (1 != npt) {
    sort(pts.begin() + spt + 1, pts.begin() + spt + npt,
         angdls(*(pts.begin() + spt)));
    int ad = 0;
    for (int i = 0; i < N - 1 && ad < npt; i++) {
      if (edg[i].first == cn || edg[i].second == cn) {
        int nv = (edg[i].first == cn) ? edg[i].second : edg[i].first;
        if (!vtd[nv]) {
          rec_mark(nv, spt + 1 + ad, dpt[nv]);
          ad += dpt[nv];
        }
      }
    }
  }
}
int main(int argc, char const *argv[]) {
  scanf("%d", &N);
  for (int i = 0; i < N - 1; i++) scanf("%d%d", &edg[i].first, &edg[i].second);
  for (int i = 0; i < N; i++) {
    scanf("%d%d", &pts[i].x, &pts[i].y);
    pts[i].ord = i;
  }
  fill(dpt.begin(), dpt.end(), -1);
  dfs_size(1);
  sort(pts.begin(), pts.begin() + N, yl);
  fill(vtd, vtd + N + 1, false);
  rec_mark(1, 0, dpt[1]);
  sort(pts.begin(), pts.begin() + N, ordl);
  for (int i = 0; i < N; i++)
    printf("%d%s", pts[i].vw, ((i - N + 1) ? " " : "\n"));
  return 0;
}
