#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
inline int getInt() {
  int x;
  scanf("%d", &x);
  return x;
}
inline long long getLL() {
  long long x;
  scanf("%lld", &x);
  return x;
};
inline int NUM(char c) { return (int)c - 48; }
inline char CHR(int n) { return (char)(n + 48); }
template <class T>
inline T MAX(T a, T b) {
  if (a > b) return a;
  return b;
}
template <class T>
inline T MIN(T a, T b) {
  if (a < b) return a;
  return b;
}
inline void OPEN(const string &s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
int V;
vector<int> G[1500 + 5];
int x[1500 + 5], y[1500 + 5];
int ans[1500 + 5];
vector<int> titik, vert;
int get_id[1500 + 5];
int idd = 1;
int sortidx = -1;
vector<int> vtmp;
inline bool cmp(const int &a, const int &b) {
  int x1 = x[a] - x[sortidx];
  int y1 = y[a] - y[sortidx];
  int x2 = x[b] - x[sortidx];
  int y2 = y[b] - y[sortidx];
  return ((long long)x1 * y2 - (long long)x2 * y1) > 0;
}
inline void dfs(int v, int id) {
  get_id[v] = -1;
  vtmp.push_back(v);
  for (int i = 0, _n = ((G[v]).size()); i < _n; i++) {
    int w = G[v][i];
    if (get_id[w] == id) dfs(w, id);
  }
}
void solve(vector<int>::iterator titik_awal, vector<int>::iterator titik_akhir,
           vector<int>::iterator vert_awal, vector<int>::iterator vert_akhir) {
  if (titik_awal == titik_akhir) return;
  int v = *vert_awal;
  ans[*titik_awal] = v;
  if (vert_akhir - vert_awal == 1) return;
  sortidx = *titik_awal;
  sort(titik_awal + 1, titik_akhir, cmp);
  idd++;
  int cur = idd;
  for (vector<int>::iterator it = vert_awal; it != vert_akhir; it++) {
    get_id[*it] = cur;
  }
  int w = -1;
  vtmp.clear();
  vtmp.push_back(v);
  get_id[v] = -1;
  vector<int> T;
  for (int i = 0, _n = ((G[v]).size()); i < _n; i++) {
    if (get_id[G[v][i]] == cur) {
      w = G[v][i];
      T.push_back(w);
      dfs(w, cur);
    }
  }
  for (vector<int>::iterator it = vert_awal; it != vert_akhir; it++) {
    *it = vtmp[it - vert_awal];
  }
  vtmp.clear();
  int j = 0;
  for (vector<int>::iterator it = vert_awal + 1; it != vert_akhir; it++) {
    if (j == (T).size()) break;
    if ((*it) != T[j]) continue;
    j++;
    vector<int>::iterator it2 = it;
    if (j == (T).size())
      it2 = vert_akhir;
    else {
      while ((*it2) != T[j]) {
        it2++;
      }
    }
    solve(titik_awal + (it - vert_awal), titik_awal + (it2 - vert_awal), it,
          it2);
  }
}
int main() {
  scanf("%d", &V);
  for (int i = 0, _n = (V - 1); i < _n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  int idx = -1;
  for (int i = 0, _n = (V); i < _n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    if (idx == -1 || x[i] < x[idx]) {
      idx = i;
    }
  }
  for (int i = 0, _n = (V); i < _n; i++) titik.push_back(i);
  vert = titik;
  swap(titik[0], titik[idx]);
  solve(titik.begin(), titik.end(), vert.begin(), vert.end());
  for (int i = 0, _n = (V); i < _n; i++) {
    if (i) printf(" ");
    printf("%d", ans[i] + 1);
  }
  puts("");
  return 0;
}
