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 MAX_N = int(1e5) + 10;
int n, m;
vector<int> E[MAX_N];
int l[MAX_N], r[MAX_N], pt;
void dfs(int u, int p) {
  l[u] = pt++;
  for (vector<int>::iterator e = E[u].begin(); e != E[u].end(); ++e) {
    if (*e != p) dfs(*e, u);
  }
  r[u] = pt - 1;
}
vector<pair<int, int> > by[MAX_N];
void add(int a, int b) {
  by[l[a]].push_back(make_pair(1, b));
  by[r[a] + 1].push_back(make_pair(-1, b));
}
struct Tree {
  Tree *pl, *pr;
  int l, r;
  Tree(int l, int r) : l(l), r(r), add(0) {
    if (l + 1 == r) {
      ret = make_pair(0, 1);
      return;
    }
    pl = new Tree(l, l + r >> 1);
    pr = new Tree(l + r >> 1, r);
    update();
  }
  int add;
  pair<int, int> ret;
  pair<int, int> get(pair<int, int> a, pair<int, int> b) {
    if (b.first != a.first) return a.first < b.first ? a : b;
    a.second += b.second;
    return a;
  }
  void update() { ret = get(pl->ret, pr->ret); }
  void apply(int a) {
    add += a;
    ret.first += a;
  }
  void relax() {
    if (add != 0) {
      pl->apply(add);
      pr->apply(add);
      add = 0;
    }
  }
  void modify(int L, int R, int x) {
    if (L >= r || l >= R) return;
    if (L <= l && R >= r) {
      apply(x);
      return;
    }
    relax();
    pl->modify(L, R, x);
    pr->modify(L, R, x);
    update();
  }
} * root;
int ans[MAX_N];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    --u, --v;
    E[u].push_back(v), E[v].push_back(u);
  }
  dfs(0, -1);
  for (int i = 0; i < m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a, --b;
    add(a, b), add(a, a), add(b, a), add(b, b);
  }
  root = new Tree(0, n);
  for (int i = 0; i < n; ++i) {
    for (vector<pair<int, int> >::iterator e = by[i].begin(); e != by[i].end();
         ++e) {
      root->modify(l[e->second], r[e->second] + 1, e->first);
    }
    ans[i] = n - (root->ret.first == 0 ? root->ret.second : 0);
  }
  for (int i = 0; i < n; ++i) {
    int x = ans[l[i]];
    x = max(0, x - 1);
    printf("%d ", x);
  }
  puts("");
  return 0;
}
