#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T checkmin(T &a, T b) {
  return (a < b) ? a : a = b;
}
template <class T>
inline T checkmax(T &a, T b) {
  return (a > b) ? a : a = b;
}
template <class T>
T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (a == 0) ? b : GCD(b % a, a);
}
template <class T>
T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return (a == 0 || b == 0) ? 0 : a / GCD(a, b) * b;
}
template <class T>
inline T sqr(T X) {
  return X * X;
}
namespace Poor {
const int MaxiN = 1505;
int N;
pair<int, int> Hits;
pair<int, int> P[MaxiN];
int Belong[MaxiN], Pa[MaxiN], Sz[MaxiN];
vector<int> Adj[MaxiN];
void DFS0(int Cur) {
  Sz[Cur] = 1;
  for (typeof(Adj[Cur].begin()) it = Adj[Cur].begin(); it != Adj[Cur].end();
       ++it)
    if (*it != Pa[Cur]) {
      Pa[*it] = Cur;
      DFS0(*it);
      Sz[Cur] += Sz[*it];
    }
}
pair<long long, long long> operator-(pair<long long, long long> A,
                                     pair<long long, long long> B) {
  return make_pair(A.first - B.first, A.second - B.second);
}
long long Det(pair<long long, long long> A, pair<long long, long long> B) {
  return A.first * B.second - B.first * A.second;
}
bool Cmp1(int i, int j) { return P[i] < P[j]; }
bool Cmp2(int i, int j) { return Det(P[i] - Hits, P[j] - Hits) > 0; }
void DFS(int Cur, int Seq[]) {
  sort(Seq, Seq + Sz[Cur], Cmp1);
  Belong[Seq[0]] = Cur;
  Hits = P[Seq[0]];
  sort(Seq + 1, Seq + Sz[Cur], Cmp2);
  int Last = 1;
  for (typeof(Adj[Cur].begin()) it = Adj[Cur].begin(); it != Adj[Cur].end();
       ++it)
    if (*it != Pa[Cur]) {
      DFS(*it, Seq + Last);
      Last += Sz[*it];
    }
}
void Run() {
  scanf("%d", &N);
  for (int i = 0; i < N - 1; ++i) {
    int U, V;
    scanf("%d%d", &U, &V);
    --U, --V;
    Adj[U].push_back(V);
    Adj[V].push_back(U);
  }
  for (int i = 0; i < N; ++i) scanf("%d%d", &P[i].first, &P[i].second);
  fill(Pa, Pa + N, -1);
  DFS0(0);
  int *List = new int[N];
  for (int i = 0; i < N; ++i) List[i] = i;
  DFS(0, List);
  delete[] List;
  for (int i = 0; i < N; ++i)
    printf("%d%c", Belong[i] + 1, (i + 1 == N) ? '\n' : ' ');
}
}  // namespace Poor
int main() {
  Poor::Run();
  return 0;
}
