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 ans[100005], to[100005][2], cnt = 0;
vector<int> V[100005];
int n, m;
int segM[550000], segC[550000], sto[550000];
void dfs(int id, int prev) {
  to[id][0] = ++cnt;
  for (int i = 0; i < V[id].size(); i++) {
    int j = V[id][i];
    if (j == prev) continue;
    dfs(j, id);
  }
  to[id][1] = ++cnt;
  return;
}
vector<pair<int, int> > upd[100005];
void init(int l, int r, int id) {
  segM[id] = 0;
  segC[id] = r - l + 1;
  sto[id] = 0;
  if (l < r) {
    int m = (l + r) >> 1;
    init(l, m, id * 2);
    init(m + 1, r, id * 2 + 1);
  }
  return;
}
void flip(int l, int r, int id) {
  segM[id] += sto[id];
  if (l < r) {
    sto[id * 2] += sto[id];
    sto[id * 2 + 1] += sto[id];
  }
  sto[id] = 0;
  return;
}
void update(int l, int r, int id, int L, int R, int delta) {
  flip(l, r, id);
  if (l > R || L > r)
    return;
  else if (L <= l && r <= R) {
    sto[id] += delta;
    flip(l, r, id);
    return;
  } else {
    int m = (l + r) >> 1;
    update(l, m, id * 2, L, R, delta);
    update(m + 1, r, id * 2 + 1, L, R, delta);
    if (segM[id * 2] < segM[id * 2 + 1]) {
      segM[id] = segM[id * 2];
      segC[id] = segC[id * 2];
    } else if (segM[id * 2] > segM[id * 2 + 1]) {
      segM[id] = segM[id * 2 + 1];
      segC[id] = segC[id * 2 + 1];
    } else {
      segM[id] = segM[id * 2];
      segC[id] = segC[id * 2] + segC[id * 2 + 1];
    }
  }
}
void dfs2(int id, int prev) {
  for (int i = 0; i < upd[id].size(); i++) {
    pair<int, int> j = upd[id][i];
    update(1, n * 2, 1, j.first, j.second, 1);
  }
  for (int i = 0; i < V[id].size(); i++) {
    int j = V[id][i];
    if (prev == j) continue;
    dfs2(j, id);
  }
  ans[id] = n - (segM[1] == 0) * segC[1] / 2;
  if (ans[id] > 0) ans[id]--;
  for (int i = 0; i < upd[id].size(); i++) {
    pair<int, int> j = upd[id][i];
    update(1, n * 2, 1, j.first, j.second, -1);
  }
  return;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i < n; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    V[l].push_back(r);
    V[r].push_back(l);
  }
  dfs(1, -1);
  init(1, n * 2, 1);
  while (m--) {
    int l, r;
    scanf("%d %d", &l, &r);
    upd[l].push_back(make_pair(to[l][0], to[l][1]));
    upd[l].push_back(make_pair(to[r][0], to[r][1]));
    upd[r].push_back(make_pair(to[l][0], to[l][1]));
    upd[r].push_back(make_pair(to[r][0], to[r][1]));
  }
  dfs2(1, -1);
  for (int i = 1; i <= n; i++) printf("%d%c", ans[i], i == n ? '\n' : ' ');
  return 0;
}
