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;
int n, m;
vector<int> G[300000];
pair<int, int> req[300000];
vector<int> que[300000];
int tin[300000];
int tout[300000];
int tinorder[300000];
int T = 0;
void dfs(int v) {
  if (tin[v] != -1) return;
  tinorder[T] = v;
  tin[v] = T++;
  for (int i = 0; i < G[v].size(); i++) dfs(G[v][i]);
  tinorder[T] = -1;
  tout[v] = T++;
}
struct stree {
  stree *lt, *rt;
  int l, r;
  int sum;
  stree(stree* lt, stree* rt, int l, int r) {
    this->l = l;
    this->r = r;
    this->lt = lt;
    this->rt = rt;
    sum = (lt == 0 ? 0 : lt->sum) + (rt == 0 ? 0 : rt->sum);
  }
  stree(int t, int s) {
    lt = rt = 0;
    l = r = t;
    sum = s;
  }
};
stree* create(int l, int r) {
  if (l == r) {
    if (tinorder[l] == -1)
      return new stree(l, 0);
    else
      return new stree(l, 1);
  }
  int m = (l + r) / 2;
  return new stree(create(l, m), create(m + 1, r), l, r);
}
stree* zero(stree* t, int l, int r) {
  if (t == 0 || t->l > r || t->r < l) return t;
  if (l <= t->l && t->r <= r) return 0;
  return new stree(zero(t->lt, l, r), zero(t->rt, l, r), t->l, t->r);
}
int get(stree* t, int l, int r) {
  if (t == 0 || t->l > r || t->r < l) return 0;
  if (l <= t->l && t->r <= r) return t->sum;
  return get(t->lt, l, r) + get(t->rt, l, r);
}
int c[300000];
int an(int i, int v) { return req[i].first + req[i].second - v; }
void ddfs(int v, int p, int delta, stree* rsq) {
  if (!que[v].empty()) {
    delta += get(rsq, tin[v], tout[v]);
    rsq = zero(rsq, tin[v], tout[v]);
  }
  for (int i = 0; i < que[v].size(); i++) {
    delta += get(rsq, tin[an(que[v][i], v)], tout[an(que[v][i], v)]);
    rsq = zero(rsq, tin[an(que[v][i], v)], tout[an(que[v][i], v)]);
  }
  c[v] = delta;
  for (int i = 0; i < G[v].size(); i++)
    if (G[v][i] != p) ddfs(G[v][i], v, delta, rsq);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    G[u - 1].push_back(v - 1);
    G[v - 1].push_back(u - 1);
  }
  memset(tin, -1, sizeof tin);
  dfs(0);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    req[i] = make_pair(a, b);
    que[a].push_back(i);
    que[b].push_back(i);
  }
  ddfs(0, -1, 0, create(0, T - 1));
  for (int i = 0; i < n; i++) cout << max(0, c[i] - 1) << " ";
}
