#include <bits/stdc++.h>
using namespace std;
long long int n, ans[1505], sub[1505];
vector<long long int> adj[1505];
pair<long long int, long long int> a[1505];
pair<long long int, long long int> refer;
map<pair<long long int, long long int>, long long int> m;
bool cmp(pair<long long int, long long int> a,
         pair<long long int, long long int> b) {
  return (a.second - refer.second) * (b.first - refer.first) <
         (a.first - refer.first) * (b.second - refer.second);
}
void dfs(long long int i, long long int p) {
  sub[i]++;
  for (auto j : adj[i])
    if (j != p) dfs(j, i), sub[i] += sub[j];
}
void assign(long long int i, long long int p, long long int s,
            long long int e) {
  refer = a[s];
  ans[m[a[s]]] = i;
  sort(a + s + 1, a + e + 1, cmp);
  long long int cur = s + 1;
  for (auto j : adj[i]) {
    if (j == p) continue;
    assign(j, i, cur, cur + sub[j] - 1);
    cur += sub[j];
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    long long int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  pair<long long int, long long int> low = {1e18, 1e18};
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first >> a[i].second;
    m[a[i]] = i;
    if (a[i].second < low.second)
      low = a[i];
    else if (a[i].second == low.second && a[i].first < low.first)
      low = a[i];
  }
  dfs(1, 1);
  refer = low;
  sort(a + 1, a + n + 1, cmp);
  assign(1, 1, 1, n);
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << '\n';
  return 0;
}
