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 = (int)1e5;
const int SZ = 4 * N;
struct node {
  int min_val, cnt;
  node() {}
  node(int min_val, int cnt) {
    node ::min_val = min_val;
    node ::cnt = cnt;
  }
};
node sum(node a, node b) {
  if (a.min_val < b.min_val)
    return a;
  else if (a.min_val > b.min_val)
    return b;
  else
    return node(a.min_val, a.cnt + b.cnt);
}
int n, m, t, in[N], out[N], ans[N], topush[SZ];
node a[SZ];
vector<int> g[N], q[N];
void add(int v, int val) {
  a[v].min_val += val;
  topush[v] += val;
}
void push(int v) {
  if (topush[v]) {
    add(v * 2 + 1, topush[v]);
    add(v * 2 + 2, topush[v]);
    topush[v] = 0;
  }
}
void update(int v, int l, int r, int L, int R, int d) {
  if (R <= l || r <= L) return;
  if (L <= l && r <= R) {
    add(v, d);
    return;
  }
  push(v);
  int m = (l + r) / 2;
  update(v * 2 + 1, l, m, L, R, d);
  update(v * 2 + 2, m, r, L, R, d);
  a[v] = sum(a[v * 2 + 1], a[v * 2 + 2]);
}
int get() {
  if (a[0].min_val == 0)
    return a[0].cnt;
  else
    return 0;
}
void build(int v, int l, int r) {
  a[v].cnt = r - l;
  if (l + 1 < r) {
    int m = (l + r) / 2;
    build(v * 2 + 1, l, m);
    build(v * 2 + 2, m, r);
  }
}
void dfs(int v, int p) {
  in[v] = t++;
  for (int i = 0; i < (int)(g[v]).size(); i++) {
    int next = g[v][i];
    if (next != p) dfs(next, v);
  }
  out[v] = t;
}
void calc(int v, int p) {
  for (int i = 0; i < (int)(q[v]).size(); i++) {
    int u = q[v][i];
    update(0, 0, n, in[u], out[u], 1);
  }
  ans[v] = get();
  for (int i = 0; i < (int)(g[v]).size(); i++) {
    int next = g[v][i];
    if (next != p) calc(next, v);
  }
  for (int i = 0; i < (int)(q[v]).size(); i++) {
    int u = q[v][i];
    update(0, 0, n, in[u], out[u], -1);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    g[a - 1].push_back(b - 1);
    g[b - 1].push_back(a - 1);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    q[a - 1].push_back(b - 1);
    q[a - 1].push_back(a - 1);
    q[b - 1].push_back(a - 1);
    q[b - 1].push_back(b - 1);
  }
  build(0, 0, n);
  dfs(0, -1);
  assert(t == n);
  calc(0, -1);
  for (int i = 0; i < n; i++) cout << max(0, n - ans[i] - 1) << ' ';
  return 0;
}
