#include <bits/stdc++.h>
using namespace std;
int n, ans[2000], son[2000];
vector<int> edge[2000];
vector<pair<int, pair<int, int> > > a[2000];
pair<int, int> ori;
bool cmp(const pair<int, pair<int, int> > &a,
         const pair<int, pair<int, int> > &b) {
  return ((long long)a.second.first - ori.first) *
                 (b.second.second - ori.second) -
             ((long long)a.second.second - ori.second) *
                 (b.second.first - ori.first) <
         0;
}
void dfs1(int x, int fa) {
  son[x] = 1;
  for (typeof((edge[x]).begin()) y = (edge[x]).begin(); y != (edge[x]).end();
       y++)
    if (*y != fa) dfs1(*y, x), son[x] += son[*y];
}
void dfs(int x, int fa) {
  int j = -1;
  for (int i = (0); i <= (((int)(a[x]).size()) - 1); i++)
    if (j == -1 || a[x][i].second.first < a[x][j].second.first ||
        a[x][i].second.first == a[x][j].second.first &&
            a[x][i].second.second < a[x][j].second.second)
      j = i;
  swap(a[x][j], a[x][0]);
  ori = a[x][0].second;
  ans[a[x][0].first] = x;
  sort(a[x].begin() + 1, a[x].end(), cmp);
  int cur = 1;
  for (typeof((edge[x]).begin()) y = (edge[x]).begin(); y != (edge[x]).end();
       y++)
    if (*y != fa) {
      for (int i = (1); i <= (son[*y]); i++) a[*y].push_back(a[x][cur++]);
      dfs(*y, x);
    }
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n - 1); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    edge[x].push_back(y), edge[y].push_back(x);
  }
  for (int i = (1); i <= (n); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[1].push_back(make_pair(i, make_pair(x, y)));
  }
  dfs1(1, 0);
  dfs(1, 0);
  for (int i = (1); i <= (n); i++) cout << ans[i] << " ";
  return 0;
}
