#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int intmax = 0x3f3f3f3f;
double eps = 1e-6;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline T lowbit(T n) {
  return (n ^ (n - 1)) & n;
}
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
template <class T>
inline T checkmod(T n, T m) {
  return (n % m + m) % m;
}
inline int rand(int a, int b) {
  if (a >= b) return a;
  return rand() % (b - a) + a;
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline T euclid(T a, T b, T &x, T &y) {
  if (a < 0) {
    T d = euclid(-a, b, x, y);
    x = -x;
    return d;
  }
  if (b < 0) {
    T d = euclid(a, -b, x, y);
    y = -y;
    return d;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    T d = euclid(b, a % b, x, y);
    T t = x;
    x = y;
    y = t - (a / b) * y;
    return d;
  }
}
template <class T>
inline vector<pair<T, int> > factorize(T n) {
  vector<pair<T, int> > R;
  for (T i = 2; n > 1;) {
    if (n % i == 0) {
      int C = 0;
      for (; n % i == 0; C++, n /= i)
        ;
      R.push_back(make_pair(i, C));
    }
    i++;
    if (i > n / i) i = n;
  }
  if (n > 1) R.push_back(make_pair(n, 1));
  return R;
}
template <class T>
inline bool isPrimeNumber(T n) {
  if (n <= 1) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
inline T eularFunction(T n) {
  vector<pair<T, int> > R = factorize(n);
  T r = n;
  for (int i = 0; i < R.size(); i++) r = r / R[i].first * (R[i].first - 1);
  return r;
}
template <class T>
inline int dblcmp(T a, const T b) {
  a -= b;
  return a > eps ? 1 : (a < -eps ? -1 : 0);
}
template <class T>
inline int sgn(T a) {
  return a > eps ? 1 : (a < -eps ? -1 : 0);
}
struct vec2 {
  double x, y;
  vec2(double x = 0.0, double y = 0.0) : x(x), y(y) {}
  vec2 operator+(const vec2 &b) const { return vec2(x + b.x, y + b.y); }
  vec2 operator-(const vec2 &b) const { return vec2(x - b.x, y - b.y); }
  vec2 operator*(const double &b) const { return vec2(x * b, y * b); }
  vec2 operator/(const double &b) const { return vec2(x / b, y / b); }
  double operator*(const vec2 &b) const { return x * b.x + y * b.y; }
  double operator^(const vec2 &b) const { return x * b.y - y * b.x; }
  double len() { return sqrt(x * x + y * y); }
  vec2 unit() { return *this / len(); }
  vec2 rotate(double r) {
    vec2 t(sin(r), cos(r));
    return vec2(*this ^ t, *this * t);
  }
  bool operator<(const vec2 &b) const {
    if (dblcmp(x, b.x) != 0)
      return dblcmp(x, b.x) < 0;
    else
      return dblcmp(y, b.y) < 0;
  }
};
const int N = 1510;
struct NODE {
  int v, next;
} node[N], edge[N * 2];
int tot;
int son[N], pre[N], ds[N];
void clear() {
  tot = 0;
  memset(son, 0xff, sizeof(son));
  memset(node, 0xff, sizeof(node));
  memset(pre, 0xff, sizeof(pre));
  memset(ds, 0, sizeof(ds));
}
void addEdge(int a, int b) {
  edge[tot].next = node[a].next;
  edge[tot].v = b;
  node[a].next = tot++;
}
void dfs(int u) {
  if (son[u] != -1) return;
  son[u] = 1;
  ds[u] = 0;
  for (int i = node[u].next; i != -1; i = edge[i].next) {
    int v = edge[i].v;
    if (pre[v] != -1) continue;
    pre[v] = u;
    dfs(v);
    ds[u]++;
    son[u] += son[v];
  }
}
vec2 p[N];
int fa[N], fb[N];
int temp;
int n;
bool cmp(const int a, const int b) {
  vec2 va = p[a] - p[temp], vb = p[b] - p[temp];
  return dblcmp(va ^ vb, 0.0) < 0;
}
void gao(int u, int s, int t) {
  if (s + 1 == t) {
    fb[fa[s]] = u;
    return;
  }
  for (int i = s + 1; i < t; ++i) {
    if (p[fa[i]] < p[fa[s]]) {
      swap(fa[i], fa[s]);
    }
  }
  temp = fa[s];
  fb[temp] = u;
  sort(fa + s + 1, fa + t, cmp);
  int cnt = s + 1;
  for (int i = node[u].next; i != -1; i = edge[i].next) {
    int v = edge[i].v;
    if (pre[v] != u) continue;
    gao(v, cnt, cnt + son[v]);
    cnt += son[v];
  }
}
int main() {
  int a, b;
  while (scanf("%d", &n) != EOF) {
    clear();
    for (int i = 0; i < n - 1; ++i) {
      scanf("%d%d", &a, &b);
      addEdge(a, b);
      addEdge(b, a);
    }
    for (int i = 1; i <= n; ++i) {
      scanf("%lf%lf", &p[i].x, &p[i].y);
    }
    pre[1] = 0;
    dfs(1);
    for (int i = 0; i <= n; ++i) {
      fa[i] = i;
    }
    gao(1, 1, n + 1);
    for (int i = 1; i <= n; ++i) {
      printf("%d%c", fb[i], i == n ? '\n' : ' ');
    }
  }
  return 0;
}
