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 N = 1e5 + 5;
struct segmentree {
  int mi, num, add;
} tree[N * 16];
int n, m;
inline void pushup(int id) {
  tree[id].mi = min(tree[id << 1].mi, tree[id << 1 | 1].mi);
  tree[id].num = 0;
  if (tree[id].mi == tree[id << 1].mi) tree[id].num += tree[id << 1].num;
  if (tree[id].mi == tree[id << 1 | 1].mi)
    tree[id].num += tree[id << 1 | 1].num;
}
inline void pushdown(int id) {
  tree[id].mi += tree[id].add;
  tree[id << 1].add += tree[id].add;
  tree[id << 1 | 1].add += tree[id].add;
  tree[id].add = 0;
}
void update(int l, int r, int x, int y, int add, int id) {
  pushdown(id);
  pushdown(id << 1);
  pushdown(id << 1 | 1);
  if (x <= l && r <= y) {
    tree[id].add += add;
    pushdown(id);
    return;
  }
  int mid = (l + r) >> 1;
  if (mid >= x) update(l, mid, x, y, add, id << 1);
  if (mid < y) update(mid + 1, r, x, y, add, id << 1 | 1);
  pushup(id);
}
void build(int l, int r, int id) {
  tree[id].num = r - l + 1;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(l, mid, id << 1);
  build(mid + 1, r, id << 1 | 1);
}
vector<int> v[N], e[N];
int ans[N], pos[N], nxt[N], cnt;
void dfs(int now, int fa) {
  pos[now] = ++cnt;
  for (int i = 0; i < v[now].size(); i++) {
    int to = v[now][i];
    if (to != fa) dfs(to, now);
  }
  nxt[now] = cnt;
}
int query(int l, int r, int v, int id) {
  pushdown(id);
  if (l == r) return tree[id].mi;
  int mid = (l + r) >> 1;
  if (mid >= v)
    return query(l, mid, v, id << 1);
  else
    return query(mid + 1, r, v, id << 1 | 1);
}
void dfs2(int now, int fa) {
  for (int i = 0; i < e[now].size(); i++)
    update(1, n, pos[e[now][i]], nxt[e[now][i]], 1, 1);
  pushdown(1);
  ans[now] =
      n - (tree[1].mi == 0 ? tree[1].num : 0) - (query(1, n, pos[now], 1) != 0);
  for (int i = 0; i < v[now].size(); i++) {
    int to = v[now][i];
    if (to != fa) dfs2(to, now);
  }
  for (int i = 0; i < e[now].size(); i++)
    update(1, n, pos[e[now][i]], nxt[e[now][i]], -1, 1);
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  build(1, n, 1);
  dfs(0, -1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    e[a].push_back(b);
    e[a].push_back(a);
    e[b].push_back(b);
    e[b].push_back(a);
  }
  dfs2(0, -1);
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
