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;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream &operator<<(ostream &s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream &operator<<(ostream &s, vector<T> t) {
  for (int(i) = 0; (i) < (((int)((t).size()))); ++(i)) s << t[i] << " ";
  return s;
}
struct CoverTree {
  int *el, *ma, s, p, k, il;
  CoverTree(int size) {
    el = new int[s = 1 << (size + 1)];
    ma = new int[s];
    for (int(x) = 0; (x) < (s); ++(x)) el[x] = ma[x] = 0;
  }
  ~CoverTree() {
    delete[] el;
    delete[] ma;
  }
  void Mark(int wp, int wk, int g) {
    if (k <= wp || p >= wk) return;
    if (p <= wp && k >= wk)
      el[g] += il;
    else {
      Mark(wp, (wp + wk + 1) >> 1, 2 * g);
      Mark((wp + wk + 1) >> 1, wk, 2 * g + 1);
    }
    ma[g] =
        el[g] > 0 ? wk - wp : (wk - 1 == wp ? 0 : ma[2 * g] + ma[2 * g + 1]);
  }
  void Add(int p1, int k1, int i1) {
    p = p1;
    k = k1;
    il = i1;
    Mark(0, s / 2, 1);
  }
  int F(int wp, int wk, int g) {
    if (wp >= k || wk <= p) return 0;
    if (el[g] > 0) return min(k, wk) - max(p, wp);
    if (p <= wp && wk <= k) return ma[g];
    return wp == wk - 1 ? 0
                        : F(wp, (wp + wk + 1) >> 1, 2 * g) +
                              F((wp + wk + 1) >> 1, wk, 2 * g + 1);
  }
  int Find(int p1, int k1) {
    p = p1;
    k = k1;
    return F(0, s / 2, 1);
  }
};
vector<int> adj[100007], links[100007];
int newnum[100007], maxinsubtree[100007], parent[100007], res[100007],
    oldnum[100007], n;
int t = 0;
void dfs(int v, int p) {
  newnum[v] = ++t;
  oldnum[newnum[v]] = v;
  maxinsubtree[newnum[v]] = newnum[v];
  for (typeof(adj[v].begin()) x = adj[v].begin(); x != adj[v].end(); x++)
    if (*x != p) {
      dfs(*x, v);
      (maxinsubtree[newnum[v]]) =
          max((maxinsubtree[newnum[v]]), (maxinsubtree[newnum[*x]]));
      ;
    }
  parent[v] = newnum[p];
}
CoverTree ct(17);
void go(int v, int p) {
  for (typeof(links[v].begin()) x = links[v].begin(); x != links[v].end();
       x++) {
    ct.Add(*x, maxinsubtree[*x] + 1, 1);
    ct.Add(v, maxinsubtree[v] + 1, 1);
  }
  res[v] = ct.Find(0, n + 1);
  if (res[v] > 0) res[v] -= 1;
  for (typeof(adj[oldnum[v]].begin()) x = adj[oldnum[v]].begin();
       x != adj[oldnum[v]].end(); x++) {
    int w = newnum[*x];
    if (w != p) go(w, v);
  }
  for (typeof(links[v].begin()) x = links[v].begin(); x != links[v].end();
       x++) {
    ct.Add(*x, maxinsubtree[*x] + 1, -1);
    ct.Add(v, maxinsubtree[v] + 1, -1);
  }
}
int main() {
  scanf("%d", &n);
  int(m);
  scanf("%d", &(m));
  for (int(i) = 0; (i) < (n - 1); ++(i)) {
    int(u), (v);
    scanf("%d %d", &(u), &(v));
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  while (m--) {
    int(a), (b);
    scanf("%d %d", &(a), &(b));
    a = newnum[a];
    b = newnum[b];
    links[a].push_back(b);
    links[b].push_back(a);
  }
  for (int(i) = 1; (i) <= (n); ++(i)) res[i] = 0;
  go(1, 0);
  for (int(i) = 1; (i) <= (n); ++(i)) printf("%d ", res[newnum[i]]);
}
