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 INF = 0x3f3f3f3f;
const double eps = 1e-8;
const double PI = acos(-1.0);
const int MAXN = 1e5 + 5;
const int MAXM = 2e6 + 5;
const int MOD = 1e9 + 7;
int sgn(double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0)
    return -1;
  else
    return 1;
}
long long pw(long long a, long long n, long long mod) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = ret * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ret;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int n, m, tim, L[MAXN], R[MAXN], ans[MAXN];
vector<int> G[MAXN], q[MAXN];
int sum[MAXN << 2], cov[MAXN << 2];
void up(int l, int r, int rt) {
  if (sum[rt])
    cov[rt] = r - l + 1;
  else if (l != r)
    cov[rt] = cov[rt << 1] + cov[rt << 1 | 1];
  else
    cov[rt] = 0;
}
void upd(int L, int R, int v, int l, int r, int rt) {
  if (L <= l && r <= R) {
    sum[rt] += v;
    up(l, r, rt);
    return;
  }
  int mid = l + r >> 1;
  if (L <= mid) upd(L, R, v, l, mid, rt << 1);
  if (R > mid) upd(L, R, v, mid + 1, r, rt << 1 | 1);
  up(l, r, rt);
}
void dfs1(int u, int f) {
  L[u] = ++tim;
  for (auto v : G[u]) {
    if (v != f) dfs1(v, u);
  }
  R[u] = tim;
}
void dfs2(int u, int f) {
  for (auto o : q[u]) {
    upd(L[o], R[o], 1, 1, n, 1);
  }
  if (!q[u].empty()) {
    upd(L[u], R[u], 1, 1, n, 1);
  }
  ans[u] = cov[1];
  if (ans[u]) ans[u]--;
  for (auto v : G[u]) {
    if (v != f) dfs2(v, u);
  }
  for (auto o : q[u]) {
    upd(L[o], R[o], -1, 1, n, 1);
  }
  if (!q[u].empty()) {
    upd(L[u], R[u], -1, 1, n, 1);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int u, v;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  tim = 0;
  dfs1(1, -1);
  for (int i = 1; i < m + 1; i++) {
    scanf("%d%d", &u, &v);
    q[u].push_back(v);
    q[v].push_back(u);
  }
  dfs2(1, -1);
  for (int i = 1; i < n + 1; i++) printf("%d ", ans[i]);
}
