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> tr[110000];
int n, m, tim;
int pl[800100];
int tin[100100], tout[100100];
vector<pair<int, int> > seg[100100];
void dfs(int x, int ac) {
  tim++;
  tin[x] = tim;
  for (int i = 0; i < tr[x].size(); i++) {
    if (tr[x][i] != ac) dfs(tr[x][i], x);
  }
  tim++;
  tout[x] = tim;
}
int mint[800100], cnt[800100];
int ans[100100];
void build(int v, int st, int fin) {
  mint[v] = 0;
  cnt[v] = fin - st + 1;
  if (st < fin) {
    build(2 * v + 1, st, (st + fin) / 2);
    build(2 * v + 2, (st + fin) / 2 + 1, fin);
  }
}
void add(int v, int st, int fin, int l, int r) {
  if (st == l && fin == r) {
    pl[v]++;
    mint[v]++;
  } else {
    if ((st + fin) / 2 >= r) add(2 * v + 1, st, (st + fin) / 2, l, r);
    if ((st + fin) / 2 + 1 <= l) add(2 * v + 2, (st + fin) / 2 + 1, fin, l, r);
    if (l <= (st + fin) / 2 && r >= (st + fin) / 2 + 1) {
      add(2 * v + 1, st, (st + fin) / 2, l, (st + fin) / 2);
      add(2 * v + 2, (st + fin) / 2 + 1, fin, (st + fin) / 2 + 1, r);
    }
    if (mint[2 * v + 1] < mint[2 * v + 2])
      mint[v] = mint[2 * v + 1], cnt[v] = cnt[2 * v + 1];
    if (mint[2 * v + 1] > mint[2 * v + 2])
      mint[v] = mint[2 * v + 2], cnt[v] = cnt[2 * v + 2];
    if (mint[2 * v + 1] == mint[2 * v + 2])
      mint[v] = mint[2 * v + 1], cnt[v] = cnt[2 * v + 1] + cnt[2 * v + 2];
    mint[v] += pl[v];
  }
}
void del(int v, int st, int fin, int l, int r) {
  if (st == l && fin == r) {
    pl[v]--;
    mint[v]--;
  } else {
    if ((st + fin) / 2 >= r) del(2 * v + 1, st, (st + fin) / 2, l, r);
    if ((st + fin) / 2 + 1 <= l) del(2 * v + 2, (st + fin) / 2 + 1, fin, l, r);
    if (l <= (st + fin) / 2 && r >= (st + fin) / 2 + 1) {
      del(2 * v + 1, st, (st + fin) / 2, l, (st + fin) / 2),
          del(2 * v + 2, (st + fin) / 2 + 1, fin, (st + fin) / 2 + 1, r);
    }
    if (mint[2 * v + 1] < mint[2 * v + 2])
      mint[v] = mint[2 * v + 1], cnt[v] = cnt[2 * v + 1];
    if (mint[2 * v + 1] > mint[2 * v + 2])
      mint[v] = mint[2 * v + 2], cnt[v] = cnt[2 * v + 2];
    if (mint[2 * v + 1] == mint[2 * v + 2])
      mint[v] = mint[2 * v + 1], cnt[v] = cnt[2 * v + 1] + cnt[2 * v + 2];
    mint[v] += pl[v];
  }
}
inline int query() {
  if (mint[0] > 0) return n - 1;
  if (cnt[0] == 2 * n) return 0;
  return n - cnt[0] / 2 - 1;
}
void dfs2(int x, int ac) {
  for (int i = 0; i < seg[x].size(); i++) {
    add(0, 1, tim, seg[x][i].first, seg[x][i].second);
  }
  ans[x] = query();
  for (int i = 0; i < tr[x].size(); i++) {
    if (tr[x][i] != ac) dfs2(tr[x][i], x);
  }
  for (int i = 0; i < seg[x].size(); i++) {
    del(0, 1, tim, seg[x][i].first, seg[x][i].second);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i < n; i++) {
    int aa, bb;
    scanf("%d%d", &aa, &bb);
    tr[aa].push_back(bb);
    tr[bb].push_back(aa);
  }
  dfs(1, -1);
  for (int i = 1; i <= m; i++) {
    int aa, bb;
    scanf("%d%d", &aa, &bb);
    seg[aa].push_back(make_pair(tin[aa], tout[aa]));
    seg[aa].push_back(make_pair(tin[bb], tout[bb]));
    seg[bb].push_back(make_pair(tin[bb], tout[bb]));
    seg[bb].push_back(make_pair(tin[aa], tout[aa]));
  }
  build(0, 1, tim);
  dfs2(1, -1);
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
