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> e[400010], b[400010];
int ll[400010], rr[400010], son[400010], No, an[400010], now;
void dfs0(int x, int last) {
  son[x] = 1;
  ll[x] = No++;
  for (int i = 0; i < e[x].size(); i++) {
    if (e[x][i] == last) continue;
    dfs0(e[x][i], x);
    son[x] += son[e[x][i]];
  }
  rr[x] = No++;
}
int ac[400010 << 1], ha[400010 << 1];
void insert(int d[], int id, int L, int R, int L2, int R2, int v) {
  if (L2 <= L && R <= R2) {
    d[id] += v;
    return;
  }
  int M = (L + R) >> 1;
  if (R2 <= M)
    insert(d, id << 1, L, M, L2, R2, v);
  else if (M < L2)
    insert(d, (id << 1) | 1, M + 1, R, L2, R2, v);
  else {
    insert(d, id << 1, L, M, L2, R2, v);
    insert(d, (id << 1) | 1, M + 1, R, L2, R2, v);
  }
}
int qq(int d[], int id, int L, int R, int x) {
  if (L == x && x == R) {
    return d[id];
  }
  int M = (L + R) >> 1;
  if (x <= M)
    return d[id] + qq(d, id << 1, L, M, x);
  else
    return d[id] + qq(d, (id << 1) | 1, M + 1, R, x);
}
int qq2(int d[], int id, int L, int R, int L2, int R2) {
  if (L2 <= L && R <= R2) {
    return d[id];
  }
  int M = (L + R) >> 1;
  if (R2 <= M)
    return qq2(d, id << 1, L, M, L2, R2);
  else if (M < L2)
    return qq2(d, (id << 1) | 1, M + 1, R, L2, R2);
  else
    return qq2(d, id << 1, L, M, L2, R2) +
           qq2(d, (id << 1) | 1, M + 1, R, L2, R2);
}
void insert2(int d[], int id, int L, int R, int x, int v) {
  d[id] += v;
  if (L == x && x == R) return;
  int M = (L + R) >> 1;
  if (x <= M)
    insert2(d, id << 1, L, M, x, v);
  else
    insert2(d, (id << 1) | 1, M + 1, R, x, v);
}
void dfs(int x, int last) {
  vector<int> tmp, tmp2;
  int i;
  for (i = 0; i < b[x].size(); i++) {
    if (qq(ac, 1, 1, No, ll[b[x][i]]))
      continue;
    else {
      tmp.push_back(b[x][i]);
      insert(ac, 1, 1, No, ll[b[x][i]], rr[b[x][i]], 1);
      int get_v = qq2(ha, 1, 1, No, ll[b[x][i]], rr[b[x][i]]);
      insert2(ha, 1, 1, No, ll[b[x][i]], son[b[x][i]] - get_v);
      tmp2.push_back(son[b[x][i]] - get_v);
      now += son[b[x][i]] - get_v;
    }
  }
  an[x] = now;
  for (int i = 0; i < e[x].size(); i++) {
    if (e[x][i] == last) continue;
    dfs(e[x][i], x);
  }
  for (i = 0; i < tmp.size(); i++) {
    insert(ac, 1, 1, No, ll[tmp[i]], rr[tmp[i]], -1);
    insert2(ha, 1, 1, No, ll[tmp[i]], -tmp2[i]);
    now -= tmp2[i];
  }
}
int main() {
  No = 1;
  int i, j, k, n, m;
  scanf("%d%d", &n, &m);
  for (i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  for (i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    b[x].push_back(x);
    b[x].push_back(y);
    b[y].push_back(x);
    b[y].push_back(y);
  }
  dfs0(1, 0);
  dfs(1, 0);
  for (i = 1; i <= n; i++) {
    if (i != 1) printf(" ");
    printf("%d", an[i] > 0 ? (an[i] - 1) : 0);
  }
  puts("");
  return 0;
}
