#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1530;
long long n;
vector<long long> adj[MAX];
struct Point {
  long long x, y, idx;
  Point(long long x = 0, long long y = 0, long long c = 0)
      : x(x), y(y), idx(c) {}
  long long length() const { return (long long)x * x + (long long)y * y; }
};
const Point operator+(const Point& lhs, const Point& rhs) {
  return Point(lhs.x + rhs.x, lhs.y + rhs.y);
}
const Point operator-(const Point& lhs, const Point& rhs) {
  return Point(lhs.x - rhs.x, lhs.y - rhs.y);
}
const Point operator~(const Point& lhs) { return Point(-lhs.y, lhs.x); }
long long operator^(const Point& lhs, const Point& rhs) {
  return lhs.x * rhs.y - lhs.y * rhs.x;
}
long long operator*(const Point& lhs, const Point& rhs) {
  return lhs.x * rhs.x + lhs.y * rhs.y;
}
Point& operator+=(Point& lhs, const Point& rhs) {
  lhs.x += rhs.x;
  lhs.y += rhs.y;
  return lhs;
}
Point& operator-=(Point& lhs, const Point& rhs) {
  lhs.x -= rhs.x;
  lhs.y -= rhs.y;
  return lhs;
}
vector<Point> ps;
int sz[MAX];
void dfs(int v, int pa) {
  sz[v] = 1;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u != pa) {
      dfs(u, v);
      sz[v] += sz[u];
    }
  }
}
long long ans[MAX];
long long dist(const Point& lhs, const Point& rhs) {
  return (lhs - rhs).length();
}
bool Less(const Point& a, const Point& b, const Point& x) {
  Point hor(1, 0), va = a - x, vb = b - x;
  if ((va ^ vb) == 0 && va.x * vb.x > 0) {
    if (dist(va, x) < dist(vb, x))
      return 1;
    else
      return 0;
  }
  if ((va ^ hor) == 0) {
    if (va.x > 0 && !((vb ^ hor) == 0 && vb.x > 0)) return 1;
    if (va.x < 0 && (vb ^ hor) > 0) return 1;
    return 0;
  } else if ((va ^ hor) < 0) {
    if ((vb ^ hor) == 0 && vb.x < 0) return 1;
    if ((vb ^ hor) < 0 && (vb ^ va) < 0) return 1;
    if ((vb ^ hor) > 0) return 1;
    return 0;
  } else {
    if ((vb ^ va) < 0 && (vb ^ hor) > 0) return 1;
    return 0;
  }
}
class cmp {
 public:
  Point x;
  cmp(const Point& a) : x(a) {}
  bool operator()(const Point& a, const Point& b) { return Less(a, b, x); }
};
void sortPolarCoor(vector<Point>& ps, const Point& key) {
  sort(ps.begin(), ps.end(), cmp(key));
}
void build(int v, int pa, int cidx, const vector<Point>& ps) {
  if (ps.size() == 1) {
    assert(sz[v] == 1);
    ans[ps[cidx].idx] = v;
    return;
  } else {
    ans[ps[cidx].idx] = v;
    vector<Point> tmp;
    for (int i = 0; i < ps.size(); i++)
      if (i != cidx) tmp.push_back(ps[i]);
    sortPolarCoor(tmp, ps[cidx]);
    int start = 0;
    for (int i = 0; i < adj[v].size(); i++) {
      int u = adj[v][i];
      if (u != pa) {
        int cnt = 0;
        vector<Point> uu;
        while (cnt < sz[u]) {
          uu.push_back(tmp[start]);
          start++, cnt++;
        }
        int idx, miy = INT_MAX, mix;
        for (long long i = (0); i <= ((int)uu.size() - 1); ++i) {
          if (uu[i].y < miy) {
            miy = uu[i].y, mix = uu[i].x, idx = i;
          } else if (uu[i].y == miy && uu[i].x < mix) {
            mix = uu[i].x, idx = i;
          }
        }
        build(u, v, idx, uu);
      }
    }
  }
}
int main() {
  scanf("%lld", &n);
  for (long long i = (1); i <= (n - 1); ++i) {
    long long x, y;
    scanf("%lld", &x), scanf("%lld", &y);
    adj[x].push_back(y), adj[y].push_back(x);
  }
  for (long long i = (1); i <= (n); ++i) {
    long long x, y;
    scanf("%lld", &x), scanf("%lld", &y);
    ps.push_back(Point(x, y, i));
  }
  dfs(1, -1);
  int idx, miy = INT_MAX, mix;
  for (long long i = (0); i <= ((int)ps.size() - 1); ++i) {
    if (ps[i].y < miy) {
      miy = ps[i].y, mix = ps[i].x, idx = i;
    } else if (ps[i].y == miy && ps[i].x < mix) {
      mix = ps[i].x, idx = i;
    }
  }
  build(1, -1, idx, ps);
  for (long long i = (1); i <= (n); ++i) printf("%lld ", ans[i]);
  printf("\n");
  return 0;
}
