#include <bits/stdc++.h>
using namespace std;
long long n, u, v, i, a[1508], s[1508], x[1508], y[1508], z[1508];
vector<long long> gr[1508];
bool cmp(long long q, long long p) {
  return (u - x[p]) * (v - y[q]) < (u - x[q]) * (v - y[p]);
}
long long dfs1(long long q, long long p) {
  for (long long r = gr[q].size(); r--;)
    if (gr[q][r] == p)
      gr[q].erase(gr[q].begin() + r);
    else
      s[q] += dfs1(gr[q][r], q);
  return ++s[q];
}
void dfs2(long long q, long long p, long long r = 0) {
  for (r = p + s[q] - 1; r-- > p;
       pair<long long, long long>(x[z[r + 1]], y[z[r + 1]]) <
               pair<long long, long long>(x[z[r]], y[z[r]])
           ? swap(z[r], z[r + 1])
           : (void)0)
    ;
  for (u = x[z[p]], v = y[z[p]], sort(z + p + 1, z + p + s[q], cmp),
      r = gr[a[z[p++]] = q].size();
       r--; dfs2(gr[q][r], p), p += s[gr[q][r]])
    ;
}
int main() {
  for (scanf("%lld", &n), i = n; --i;
       scanf("%lld%lld", &u, &v), gr[u].push_back(v), gr[v].push_back(u))
    ;
  for (i = 0; i++ < n; z[i] = i, scanf("%lld%lld", x + i, y + i))
    ;
  for (dfs1(1, i = 0), dfs2(1, 1); i++ < n; printf("%lld ", a[i]))
    ;
  exit(0);
}
