#include <bits/stdc++.h>
using namespace std;
class Scanner {
 private:
  static const int BUFFER_SIZE = 10000;
  char buff[BUFFER_SIZE];
  int buffPos, buffLim;

 public:
  Scanner() {
    buffLim = fread(buff, 1, BUFFER_SIZE, stdin);
    buffPos = 0;
  }

 private:
  inline void flushBuff() {
    buffLim = fread(buff, 1, BUFFER_SIZE, stdin);
    if (buffLim == 0) {
      buff[buffLim++] = '\n';
    }
    buffPos = 0;
  }
  inline bool isWS(char t) { return t == ' ' || t == '\n'; }
  inline bool isDig(char t) { return t >= '0' && t <= '9'; }
  void nextPos() {
    buffPos++;
    if (buffPos == buffLim) {
      flushBuff();
    }
  }

 public:
  inline char getchar() {
    char ch = buff[buffPos];
    nextPos();
    return ch;
  }
  inline void next(char* s) {
    while (isWS(buff[buffPos])) {
      nextPos();
    }
    while (!isWS(buff[buffPos])) {
      *s = buff[buffPos];
      s++;
      nextPos();
    }
    *s = '\0';
  }
  inline void nextLine(char* s) {
    while (buff[buffPos] != '\n') {
      nextPos();
    }
    if (buff[buffPos] == '\n') {
      nextPos();
    }
    while (buff[buffPos] != '\n') {
      *s = buff[buffPos];
      s++;
      buffPos++;
    }
    *s = '\0';
  }
  inline int nextInt() {
    while (!isDig(buff[buffPos]) && buff[buffPos] != '-') {
      nextPos();
    }
    int sign = (buff[buffPos] == '-') ? nextPos(), -1 : 1;
    int res = 0;
    while (isDig(buff[buffPos])) {
      res = res * 10 + buff[buffPos] - '0';
      nextPos();
    }
    return res * sign;
  }
  inline int n() {
    while (buff[buffPos] < '0' || buff[buffPos] > '9') {
      buffPos++;
      if (buffPos == buffLim) {
        flushBuff();
      }
    }
    int res = 0;
    while (buff[buffPos] >= '0' && buff[buffPos] <= '9') {
      res = res * 10 + (buff[buffPos] - '0');
      buffPos++;
      if (buffPos == buffLim) {
        flushBuff();
      }
    }
    return res;
  }
  inline double nextDouble() {
    while (isWS(buff[buffPos])) {
      nextPos();
    }
    int sign = (buff[buffPos] == '-') ? nextPos(), -1 : 1;
    double res = 0;
    while (isDig(buff[buffPos])) {
      res = res * 10 + buff[buffPos] - '0';
      nextPos();
    }
    if (buff[buffPos] == '.') {
      nextPos();
      double ep = 1;
      while (isDig(buff[buffPos])) {
        ep *= 0.1;
        res += ep * (buff[buffPos] - '0');
        nextPos();
      }
    }
    return sign * res;
  }
  inline char nextChar() {
    while (isWS(buff[buffPos])) nextPos();
    char res = buff[buffPos];
    nextPos();
    return res;
  }
};
Scanner sc;
template <class T>
inline bool checkMin(T& a, T b) {
  return (a > b ? a = b, 1 : 0);
}
template <class T>
inline bool checkMax(T& a, T b) {
  return (a < b ? a = b, 1 : 0);
}
void ALERT(bool judgememt, const char* phrase) {
  if (judgememt) {
    puts(phrase);
    throw "ALERT";
  }
}
bool alert(bool judgememt, const char* phrase) {
  if (judgememt) puts(phrase);
  return judgememt;
}
void preInit();
void init();
void solve();
int32_t main() {
  preInit();
  init();
  solve();
  return 0;
}
const int N = 1505;
vector<int> e[N];
int sz[N];
struct Pt {
  int x, y, id;
} p[N];
int n;
void preInit() {}
void init() {
  n = sc.n();
  for (int i = 0; i < n - 1; i++) {
    int u = sc.n(), v = sc.n();
    e[u].push_back(v);
    e[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    int x = sc.nextInt(), y = sc.nextInt();
    p[i] = {x, y, i + 1};
  }
}
void dfs0(int u, int f) {
  sz[u] = 1;
  for (int v : e[u])
    if (v != f) {
      dfs0(v, u);
      sz[u] += sz[v];
    }
}
int ans[N];
void dfs(int u, int f, int l, int r) {
  ;
  for (int i = l + 1; i <= r; i++)
    if (p[i].y > p[l].y) {
      swap(p[i], p[l]);
    }
  ans[p[l].id] = u;
  Pt key = p[l];
  sort(p + l + 1, p + r + 1, [key](Pt a, Pt b) {
    int ax = a.x - key.x, ay = a.y - key.y;
    int bx = b.x - key.x, by = b.y - key.y;
    return 1LL * ax * by < 1LL * ay * bx;
  });
  for (int i = l; i <= r; i++) {
    ;
  }
  int st = l + 1;
  for (int v : e[u])
    if (v != f) {
      dfs(v, u, st, st + sz[v] - 1);
      st += sz[v];
    }
}
void solve() {
  dfs0(1, 0);
  dfs(1, 0, 0, n - 1);
  for (int i = 1; i <= n; i++) printf("%d%c", ans[i], " \n"[i == n]);
}
