#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y, id, address;
  Point() { x = y = 0; }
  Point(int _x, int _y) {
    x = _x;
    y = _y;
  }
  void input(void) const { scanf("%d %d", &x, &y); }
  void print() { cout << x << " " << y << endl; }
  bool operator<(const Point& o) const {
    if (y == o.y) return x < o.x;
    return y < o.y;
  }
};
long long cross_product(const Point& o, const Point& a, const Point& b) {
  return 1LL * (a.x - o.x) * (b.y - o.y) - 1LL * (a.y - o.y) * (b.x - o.x);
}
Point root;
bool cpr(const Point& u, const Point& v) {
  return (cross_product(root, u, v) > 0);
}
const int N = 1505;
int socon[N];
vector<int> g[N];
void dfs(int u, int p) {
  socon[u] = 1;
  for (__typeof((g[u]).begin()) it = g[u].begin(); it != g[u].end(); it++) {
    if (*it != p) {
      dfs(*it, u);
      socon[u] += socon[*it];
    }
  }
}
int ans[N];
Point tap[N];
void solve(int u, int p, int l, int r) {
  if (l > r) return;
  sort(tap + l, tap + r + 1);
  root = tap[l];
  ans[tap[l].id] = u;
  sort(tap + l + 1, tap + r + 1, cpr);
  int bl = l + 1, br = l + 1;
  for (__typeof((g[u]).begin()) it = g[u].begin(); it != g[u].end(); it++) {
    int v = *it;
    if (v == p) continue;
    br = bl + socon[v] - 1;
    solve(v, u, bl, br);
    bl = bl + socon[v];
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, -1);
  for (int i = 1; i <= n; i++) {
    tap[i].input();
    tap[i].id = i;
  }
  sort(tap + 1, tap + 1 + n);
  solve(1, -1, 1, n);
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
}
