The Little Elephant loves trees very much, he especially loves root trees.

He's got a tree consisting of n nodes (the nodes are numbered from 1 to n), with root at node number 1. Each node of the tree contains some list of numbers which initially is empty. 

The Little Elephant wants to apply m operations. On the i-th operation (1 ≤ i ≤ m) he first adds number i to lists of all nodes of a subtree with the root in node number ai, and then he adds number i to lists of all nodes of the subtree with root in node bi.

After applying all operations the Little Elephant wants to count for each node i number ci — the number of integers j (1 ≤ j ≤ n; j ≠ i), such that the lists of the i-th and the j-th nodes contain at least one common number.

Help the Little Elephant, count numbers ci for him.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 105) — the number of the tree nodes and the number of operations. 

Each of the following n - 1 lines contains two space-separated integers, ui and vi (1 ≤ ui, vi ≤ n, ui ≠ vi), that mean that there is an edge between nodes number ui and vi. 

Each of the following m lines contains two space-separated integers, ai and bi (1 ≤ ai, bi ≤ n, ai ≠ bi), that stand for the indexes of the nodes in the i-th operation.

It is guaranteed that the given graph is an undirected tree.

Output

In a single line print n space-separated integers — c1, c2, ..., cn.

Examples

Input

5 1
1 2
1 3
3 5
3 4
2 3


Output

0 3 3 3 3 

Input

11 3
1 2
2 3
2 4
1 5
5 6
5 7
5 8
6 9
8 10
8 11
2 9
3 6
2 8


Output

0 6 7 6 0 2 0 5 4 5 5 
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 210000;
namespace SegTree {
struct Node {
  int val, cnt, addn;
  bool operator<(const Node x) const { return val < x.val; }
} tree[MAXN << 2];
Node merge(Node l, Node r) {
  l.addn = r.addn = 0;
  if (l.val == r.val)
    return (Node){l.val, l.cnt + r.cnt, 0};
  else
    return min(l, r);
}
void add(int nown, int v) { tree[nown].addn += v, tree[nown].val += v; }
void push_down(int nown) {
  if (tree[nown].addn != 0) {
    add((nown << 1), tree[nown].addn), add((nown << 1 | 1), tree[nown].addn);
    tree[nown].addn = 0;
  }
}
void build(int nown, int l, int r) {
  if (l == r) {
    tree[nown] = (Node){0, 1, 0};
  } else {
    build((nown << 1), l, ((l + r) >> 1));
    build((nown << 1 | 1), ((l + r) >> 1) + 1, r);
    tree[nown] = merge(tree[(nown << 1)], tree[(nown << 1 | 1)]);
  }
}
void update(int nown, int l, int r, int ql, int qr, int v) {
  if (ql <= l && r <= qr) {
    add(nown, v);
  } else {
    push_down(nown);
    if (ql <= ((l + r) >> 1)) update((nown << 1), l, ((l + r) >> 1), ql, qr, v);
    if (qr >= ((l + r) >> 1) + 1)
      update((nown << 1 | 1), ((l + r) >> 1) + 1, r, ql, qr, v);
    tree[nown] = merge(tree[(nown << 1)], tree[(nown << 1 | 1)]);
  }
}
int query(int n) {
  Node tmp = tree[1];
  if (tmp.val != 0)
    return n;
  else
    return n - tmp.cnt;
}
}  // namespace SegTree
int n, m;
struct Edge {
  int to, nex;
} edge[MAXN * 2];
int ecnt = 2;
int fir[MAXN];
void addedge(int a, int b) {
  edge[ecnt] = (Edge){b, fir[a]};
  fir[a] = ecnt++;
}
int x[MAXN], y[MAXN];
int id[MAXN], siz[MAXN], cnt, back[MAXN];
void dfs0(int nown, int fa) {
  id[nown] = ++cnt;
  siz[nown] = 1;
  back[cnt] = nown;
  for (int nowe = fir[nown]; nowe; nowe = edge[nowe].nex) {
    int v = edge[nowe].to;
    if (v == fa) continue;
    dfs0(v, nown);
    siz[nown] += siz[v];
  }
}
void init() {
  scanf("%d %d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    addedge(a, b), addedge(b, a);
  }
}
struct Node {
  int x, l, r, v, o;
};
bool cmp(Node a, Node b) { return a.x < b.x; }
vector<Node> v;
void add(int a, int b) {
  if (id[a] > id[b]) swap(a, b);
  if (id[a] + siz[a] - 1 >= id[b] + siz[b] - 1) {
    v.push_back((Node){id[a], id[a], id[a] + siz[a] - 1, 1, 0});
    v.push_back((Node){id[a] + siz[a], id[a], id[a] + siz[a] - 1, -1, 0});
  } else {
    v.push_back((Node){id[a], id[a], id[a] + siz[a] - 1, 1, b});
    v.push_back((Node){id[a] + siz[a], id[a], id[a] + siz[a] - 1, -1, b});
    v.push_back((Node){id[b], id[b], id[b] + siz[b] - 1, 1, a});
    v.push_back((Node){id[b] + siz[b], id[b], id[b] + siz[b] - 1, -1, a});
  }
}
int ans[MAXN];
void solve() {
  dfs0(1, 0);
  SegTree::build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &x[i], &y[i]);
    add(x[i], y[i]);
  }
  sort(v.begin(), v.end(), cmp);
  int L = 0;
  for (int i = 1; i <= n; i++) {
    while (L < int(v.size()) && v[L].x <= i) {
      SegTree::update(1, 1, n, v[L].l, v[L].r, v[L].v);
      if (v[L].o != 0) {
        int t = v[L].o;
        SegTree::update(1, 1, n, id[t], id[t] + siz[t] - 1, v[L].v);
      }
      L++;
    }
    ans[back[i]] = SegTree::query(n);
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", max(0, ans[i] - 1));
  }
  printf("\n");
}
int main() {
  init();
  solve();
  return 0;
}
