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 = 100001;
int lazy[4 * N], n, m, a, b, cnt = 1, st[N], ed[N], c[N];
vector<pair<int, int> > it[N];
vector<int> g[N];
pair<int, int> seg[4 * N];
void build(int n, int s, int e) {
  if (s == e) {
    seg[n].second = 1;
    return;
  }
  build(2 * n, s, (s + e) / 2);
  build(2 * n + 1, (s + e) / 2 + 1, e);
  seg[n].second = seg[2 * n].second + seg[2 * n + 1].second;
}
void push(int n, int s, int e) {
  if (lazy[n]) {
    seg[n].first += lazy[n];
    if (s != e) lazy[2 * n] += lazy[n], lazy[2 * n + 1] += lazy[n];
    lazy[n] = 0;
  }
}
void update(int n, int s, int e, int l, int r, int val) {
  push(n, s, e);
  if (s > r || e < l) return;
  if (s >= l && e <= r) {
    lazy[n] += val;
    push(n, s, e);
    return;
  }
  update(2 * n, s, (s + e) / 2, l, r, val);
  update(2 * n + 1, (s + e) / 2 + 1, e, l, r, val);
  seg[n] = seg[2 * n];
  if (seg[2 * n + 1].first < seg[n].first) seg[n] = seg[2 * n + 1];
  if (seg[2 * n + 1].first == seg[2 * n].first)
    seg[n].second += seg[2 * n + 1].second;
}
void dfs(int u, int p) {
  st[u] = cnt++;
  for (int i = 0; i < g[u].size(); i++)
    if (g[u][i] != p) dfs(g[u][i], u);
  ed[u] = cnt - 1;
}
void solve(int u, int p) {
  for (int i = 0; i < it[u].size() && it[u].size() > 1; ++i) {
    pair<int, int> go = it[u][i];
    update(1, 1, n, go.first, go.second, 1);
  }
  c[u] = n - (seg[1].first == 0 ? seg[1].second : 0);
  for (int i = 0; i < g[u].size(); ++i) {
    if (g[u][i] != p) solve(g[u][i], u);
  }
  for (int i = 0; i < it[u].size() && it[u].size() > 1; ++i) {
    pair<int, int> go = it[u][i];
    update(1, 1, n, go.first, go.second, -1);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n - 1; ++i) {
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  build(1, 1, n);
  dfs(1, -1);
  for (int i = 1; i <= n; i++) it[i].push_back(make_pair(st[i], ed[i]));
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &a, &b);
    it[a].push_back(make_pair(st[b], ed[b]));
    it[b].push_back(make_pair(st[a], ed[a]));
  }
  solve(1, -1);
  for (int i = 1; i <= n; ++i) {
    if (i > 1) printf(" ");
    printf("%d", max(0, c[i] - 1));
  }
  puts("");
  return 0;
}
