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 = 1000000000, N = 100000;
int n, m, beg[N + 5], fin[N + 5], timer, lazy[4 * N + 5], ans[N + 5];
pair<int, int> ST[4 * N + 5];
vector<int> v[N + 5], q[N + 5];
pair<int, int> merge(pair<int, int> a, pair<int, int> b) {
  if (a.first < b.first)
    return a;
  else if (a.first > b.first)
    return b;
  else
    return make_pair(a.first, a.second + b.second);
}
pair<int, int> init(int i, int b, int s) {
  if (b == s) return ST[i] = make_pair(0, 1);
  int o = (b + s) / 2;
  return ST[i] = merge(init(2 * i, b, o), init(2 * i + 1, o + 1, s));
}
pair<int, int> update(int i, int b, int s, int x, int y, int t) {
  if (x > s || y < b) return ST[i];
  if (x <= b && y >= s) {
    lazy[i] += t;
    ST[i].first += t;
    return ST[i];
  }
  int o = (b + s) / 2;
  ST[i] =
      merge(update(2 * i, b, o, x, y, t), update(2 * i + 1, o + 1, s, x, y, t));
  ST[i].first += lazy[i];
  return ST[i];
}
int count() { return ST[1].first ? n : n - ST[1].second; }
void dfs(int dad, int node) {
  beg[node] = ++timer;
  int sz = v[node].size();
  for (int i = 0; i < sz; i++) {
    int to = v[node][i];
    if (to != dad) {
      dfs(node, to);
    }
  }
  fin[node] = timer;
}
void solve(int dad, int node) {
  int sz = q[node].size();
  if (sz) update(1, 1, n, beg[node], fin[node], 1);
  for (int i = 0; i < sz; i++)
    update(1, 1, n, beg[q[node][i]], fin[q[node][i]], 1);
  ans[node] = count();
  sz = v[node].size();
  for (int i = 0; i < sz; i++) {
    int to = v[node][i];
    if (to != dad) {
      solve(node, to);
    }
  }
  sz = q[node].size();
  if (sz) update(1, 1, n, beg[node], fin[node], -1);
  for (int i = 0; i < sz; i++)
    update(1, 1, n, beg[q[node][i]], fin[q[node][i]], -1);
}
int main() {
  int x, y;
  scanf("%d %d", &n, &m);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &x, &y);
    q[x].push_back(y);
    q[y].push_back(x);
  }
  init(1, 1, n);
  dfs(0, 1);
  solve(0, 1);
  for (int i = 1; i <= n; i++) printf("%d ", ans[i] - bool(ans[i]));
  puts("");
  return 0;
}
