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 node {
  int cnt, mn;
  node() {
    cnt = 1;
    mn = 0;
  };
};
const int maxn = 1e5 + 5;
int st[maxn], fn[maxn], a[maxn], b[maxn], ans[maxn];
node seg[maxn * 4];
int lzy[maxn * 4];
vector<int> adj[maxn], qu[maxn];
int n;
int tim = 0;
void dfs(int v, int p = -1) {
  st[v] = tim++;
  for (int u : adj[v]) {
    if (u != p) {
      dfs(u, v);
    }
  }
  fn[v] = tim;
}
void shift(int l, int r, int x) {
  if (l + 1 >= r || !lzy[x]) {
    return;
  }
  seg[x * 2].mn += lzy[x];
  seg[x * 2 + 1].mn += lzy[x];
  lzy[x * 2] += lzy[x];
  lzy[x * 2 + 1] += lzy[x];
  lzy[x] = 0;
  return;
}
void add(int l, int r, int L, int R, int val, int x) {
  shift(l, r, x);
  if (l >= R || r <= L) {
    return;
  }
  if (l >= L && r <= R) {
    seg[x].mn += val;
    lzy[x] += val;
    return;
  }
  int mid = (l + r) / 2;
  add(l, mid, L, R, val, x * 2);
  add(mid, r, L, R, val, x * 2 + 1);
  seg[x].mn = min(seg[x * 2].mn, seg[x * 2 + 1].mn);
  seg[x].cnt = 0;
  if (seg[x * 2].mn == seg[x].mn) {
    seg[x].cnt += seg[x * 2].cnt;
  }
  if (seg[x * 2 + 1].mn == seg[x].mn) {
    seg[x].cnt += seg[x * 2 + 1].cnt;
  }
}
void build(int l, int r, int x) {
  if (l + 1 >= r) {
    seg[x].mn = 0;
    seg[x].cnt = 1;
    return;
  }
  int mid = (l + r) / 2;
  build(l, mid, x * 2);
  build(mid, r, x * 2 + 1);
  seg[x].cnt = seg[x * 2].cnt + seg[x * 2 + 1].cnt;
}
void Dfs(int v, int p = -1) {
  for (int x : qu[v]) {
    add(0, n, st[a[x]], fn[a[x]], 1, 1);
    add(0, n, st[b[x]], fn[b[x]], 1, 1);
  }
  if (seg[1].mn == 0) {
    ans[v] = n - seg[1].cnt;
  } else {
    ans[v] = n;
  }
  for (int u : adj[v]) {
    if (u != p) {
      Dfs(u, v);
    }
  }
  for (int x : qu[v]) {
    add(0, n, st[a[x]], fn[a[x]], -1, 1);
    add(0, n, st[b[x]], fn[b[x]], -1, 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int m;
  cin >> n >> m;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    a[i]--;
    b[i]--;
    qu[a[i]].push_back(i);
    qu[b[i]].push_back(i);
  }
  build(0, n, 1);
  dfs(0);
  Dfs(0);
  for (int i = 0; i < n; i++) {
    cout << ans[i] - (ans[i] != 0) << " ";
  }
  return 0;
}
