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;
struct P {
  int mn, cnt;
  P(int mn = 0, int cnt = 0) : mn(mn), cnt(cnt) {}
};
P unite(P p, P q) {
  P ret;
  ret.mn = min(p.mn, q.mn);
  if (ret.mn == p.mn) ret.cnt += p.cnt;
  if (ret.mn == q.mn) ret.cnt += q.cnt;
  return ret;
}
struct segtree {
  P seg[128 * 1024 * 2];
  int add[128 * 1024 * 2];
  int mum;
  void init(int n) {
    mum = 1;
    while (mum < n) mum <<= 1;
    memset(add, 0, sizeof(add));
    for (int i = mum - 1; i < mum + n - 1; i++) seg[i] = P(0, 1);
    for (int i = mum + n - 1; i < mum * 2; i++) seg[i] = P(1000000000, 1);
    for (int i = mum - 2; i >= 0; i--) make(i);
  }
  void make(int k) {
    seg[k] = unite(seg[k * 2 + 1], seg[k * 2 + 2]);
    seg[k].mn += add[k];
  }
  void update(int a, int b, int k, int l, int r, int v) {
    if (b <= l || r <= a) return;
    if (a <= l && r <= b) {
      seg[k].mn += v;
      add[k] += v;
    } else {
      update(a, b, k * 2 + 1, l, (l + r) / 2, v);
      update(a, b, k * 2 + 2, (l + r) / 2, r, v);
      make(k);
    }
  }
  void update(int a, int b, int v) { update(a, b, 0, 0, mum, v); }
  int get() {
    if (seg[0].mn != 0) return 0;
    return seg[0].cnt;
  }
};
segtree seg;
vector<int> vec[100005];
vector<int> add[100005];
int id[100005], ch[100005];
int ans[100005], cnt[100005];
int nw;
void dfs(int v = 0, int p = -1) {
  id[v] = nw++;
  for (int i = 0; i < vec[v].size(); i++) {
    int to = vec[v][i];
    if (to != p) dfs(to, v);
  }
  ch[v] = nw;
}
void solve(int v = 0, int p = -1) {
  for (int i = 0; i < add[v].size(); i++) {
    int to = add[v][i];
    if (cnt[v] == 0) seg.update(id[v], ch[v], 1);
    if (cnt[to] == 0) seg.update(id[to], ch[to], 1);
    cnt[v]++;
    cnt[to]++;
  }
  ans[v] = seg.get();
  for (int i = 0; i < vec[v].size(); i++) {
    int to = vec[v][i];
    if (to != p) solve(to, v);
  }
  for (int i = 0; i < add[v].size(); i++) {
    int to = add[v][i];
    cnt[v]--;
    cnt[to]--;
    if (cnt[v] == 0) seg.update(id[v], ch[v], -1);
    if (cnt[to] == 0) seg.update(id[to], ch[to], -1);
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    add[a].push_back(b);
    add[b].push_back(a);
  }
  dfs();
  seg.init(n);
  solve();
  for (int i = 0; i < n; i++) {
    if (i != 0) printf(" ");
    ans[i] = n - ans[i];
    printf("%d", max(0, ans[i] - 1));
  }
  puts("");
  return 0;
}
