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 = 100005;
int n, m;
vector<int> g[N], q[N];
bool read() {
  if (!(cin >> n >> m)) return false;
  for (int i = 0; i < int(n - 1); ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < int(m); ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    q[a].push_back(b);
    q[b].push_back(a);
  }
  return true;
}
int l[N], r[N], T;
void dfs(int v) {
  l[v] = r[v] = T++;
  for (int i = 0; i < int(g[v].size()); ++i) {
    int to = g[v][i];
    if (l[to] == -1) {
      dfs(to);
      r[v] = r[to];
    }
  }
}
pair<int, int> st[N * 4];
int upd[N * 4];
pair<int, int> merge(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first)
    return make_pair(a.first, a.second + b.second);
  else
    return min(a, b);
}
void push(int v, int l, int r) {
  if (upd[v] != 0) {
    st[v].first += upd[v];
    if (l != r) {
      upd[v * 2 + 1] += upd[v];
      upd[v * 2 + 2] += upd[v];
    }
    upd[v] = 0;
  }
}
void update(int v, int l, int r, int L, int R, int val) {
  push(v, l, r);
  if (L == l && R == r) {
    upd[v] += val;
    return;
  }
  int m = (l + r) >> 1;
  if (R <= m) update(v * 2 + 1, l, m, L, R, val);
  if (L > m) update(v * 2 + 2, m + 1, r, L, R, val);
  if (L <= m && R > m)
    update(v * 2 + 1, l, m, L, m, val),
        update(v * 2 + 2, m + 1, r, m + 1, R, val);
  push(v * 2 + 1, l, m);
  push(v * 2 + 2, m + 1, r);
  st[v] = merge(st[v * 2 + 1], st[v * 2 + 2]);
}
void build(int v, int l, int r) {
  if (l == r) {
    st[v] = make_pair(0, 1);
    return;
  }
  int m = (l + r) >> 1;
  build(v * 2 + 1, l, m);
  build(v * 2 + 2, m + 1, r);
  st[v] = merge(st[v * 2 + 1], st[v * 2 + 2]);
}
pair<int, int> get(int v, int l, int r, int L, int R) {
  push(v, l, r);
  if (l == L && r == R) return st[v];
  int m = (l + r) >> 1;
  if (R <= m) return get(v * 2 + 1, l, m, L, R);
  if (L > m) return get(v * 2 + 2, m + 1, r, L, R);
  if (L <= m && R > m)
    return merge(get(v * 2 + 1, l, m, L, m),
                 get(v * 2 + 2, m + 1, r, m + 1, R));
}
int ans[N];
void dfs2(int v) {
  for (int i = 0; i < int(q[v].size()); ++i) {
    int u = q[v][i];
    update(0, 0, T - 1, l[v], r[v], +1);
    update(0, 0, T - 1, l[u], r[u], +1);
  }
  pair<int, int> p = get(0, 0, T - 1, 0, T - 1);
  int c = T;
  if (p.first == 0) c -= p.second;
  ans[v] = max(c - 1, 0);
  for (int i = 0; i < int(g[v].size()); ++i) {
    int to = g[v][i];
    if (l[v] < l[to]) dfs2(to);
  }
  for (int i = 0; i < int(q[v].size()); ++i) {
    int u = q[v][i];
    update(0, 0, T - 1, l[v], r[v], -1);
    update(0, 0, T - 1, l[u], r[u], -1);
  }
}
void solve() {
  memset(l, -1, sizeof(l));
  dfs(0);
  build(0, 0, T - 1);
  dfs2(0);
  for (int i = 0; i < int(n); ++i) cout << ans[i] << " ";
}
int main() {
  while (read()) solve();
  return 0;
}
