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;
vector<int> G[100000 + 5];
int visit[100000 + 5];
int N, t = 0;
int par[100000 + 5];
int L[100000 + 5];
int R[100000 + 5];
int ans[100000 * 8 + 5];
int tree[100000 * 8 + 5];
int lazy[100000 * 8 + 5];
vector<int> W[100000 + 5];
void dfs(int v) {
  t++;
  L[v] = t;
  visit[v] = 1;
  for (int i = 0; i < G[v].size(); ++i) {
    if (visit[G[v][i]] == 0) par[G[v][i]] = v, dfs(G[v][i]);
  }
  R[v] = t;
}
pair<int, int> P[100000 + 5];
void update(int i, int si, int sj, int qi, int qj, int val) {
  if (si == qi and sj == qj) {
    lazy[i] += val;
    if (lazy[i] > 0)
      tree[i] = sj - si + 1;
    else
      tree[i] = tree[2 * i] + tree[2 * i + 1];
  } else {
    int mid = (si + sj) / 2;
    if (qj <= mid)
      update(2 * i, si, mid, qi, qj, val);
    else if (mid + 1 <= qi)
      update(2 * i + 1, mid + 1, sj, qi, qj, val);
    else
      update(2 * i, si, mid, qi, mid, val),
          update(2 * i + 1, mid + 1, sj, mid + 1, qj, val);
    if (lazy[i] > 0)
      tree[i] = sj - si + 1;
    else
      tree[i] = tree[2 * i] + tree[2 * i + 1];
  }
}
void rec(int v) {
  for (int i = 0; i < W[v].size(); ++i) {
    int x = P[W[v][i]].first;
    int y = P[W[v][i]].second;
    update(1, 1, N, L[x], R[x], 1);
    update(1, 1, N, L[y], R[y], 1);
  }
  ans[v] = tree[1];
  for (int i = 0; i < G[v].size(); ++i) {
    if (G[v][i] != par[v]) rec(G[v][i]);
  }
  for (int i = 0; i < W[v].size(); ++i) {
    int x = P[W[v][i]].first;
    int y = P[W[v][i]].second;
    update(1, 1, N, L[x], R[x], -1);
    update(1, 1, N, L[y], R[y], -1);
  }
}
int main() {
  int a, b, M;
  cin >> N >> M;
  for (int i = 1; i < N; ++i) {
    scanf("%d", &a);
    scanf("%d", &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1);
  for (int i = 1; i <= M; ++i) {
    scanf("%d", &a);
    scanf("%d", &b);
    W[a].push_back(i);
    W[b].push_back(i);
    P[i] = make_pair(a, b);
  }
  rec(1);
  for (int i = 1; i <= N; ++i) printf("%d ", max(0, ans[i] - 1));
}
