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 + 7;
const int M = 23;
const int inf = 1e9 + 7;
const long long base = 1e18;
const double pi = acos(-1);
const double ep = 1e-9;
int a[N * 4], b[N * 4];
long long sum[N * 4];
vector<int> adj[N], rev[N];
int n, m;
int ans[N];
int lef[N], rig[N];
int k = 0;
int pa[N];
int pos[N];
void DFS(int u) {
  lef[u] = rig[u] = ++k;
  pos[k] = u;
  for (int j = 0; j < adj[u].size(); j++) {
    int v = adj[u][j];
    if (pa[v] == 0) {
      pa[v] = u;
      DFS(v);
      rig[u] = max(rig[u], rig[v]);
    }
  }
}
void build(int i, int l, int r) {
  if (l == r) {
    a[i] = 1;
    return;
  }
  int g = (l + r) >> 1;
  build(i * 2, l, g);
  build(i * 2 + 1, g + 1, r);
  a[i] = a[i * 2] + a[i * 2 + 1];
}
void up(int i, int l, int r) {
  b[i] = 0;
  int next = i << 1;
  int g = (l + r) >> 1;
  if (a[i] > 0) {
    a[next] = g - l + 1;
    a[next + 1] = r - g;
  } else {
    a[next] = a[next + 1] = 0;
  }
  b[next] = 1;
  b[next + 1] = 1;
}
void update(int i, int l, int r, int u, int v, int val) {
  if (l == u && r == v) {
    b[i] += val;
    if (b[i] > 0)
      a[i] = 0;
    else
      a[i] = (l == r) ? 1 : a[i * 2] + a[i * 2 + 1];
    return;
  }
  int g = (l + r) >> 1, next = i << 1;
  if (u <= g) update(next, l, g, u, min(g, v), val);
  if (g < v) update(next + 1, g + 1, r, max(g + 1, u), v, val);
  if (b[i] > 0)
    a[i] = 0;
  else
    a[i] = a[next] + a[next + 1];
}
void travel(int u) {
  if (rev[u].size() > 0) {
    update(1, 1, n, lef[u], rig[u], 1);
    for (int j = 0; j < rev[u].size(); j++) {
      int v = rev[u][j];
      update(1, 1, n, lef[v], rig[v], 1);
    }
  }
  ans[u] = n - a[1] - 1;
  if (ans[u] == -1) ans[u]++;
  for (int j = 0; j < adj[u].size(); j++) {
    int v = adj[u][j];
    if (pa[v] == u) {
      travel(v);
    }
  }
  if (rev[u].size() > 0) {
    update(1, 1, n, lef[u], rig[u], -1);
    for (int j = 0; j < rev[u].size(); j++) {
      int v = rev[u][j];
      update(1, 1, n, lef[v], rig[v], -1);
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int j = 0; j < m; j++) {
    int u, v;
    scanf("%d%d", &u, &v);
    rev[u].push_back(v);
    rev[v].push_back(u);
  }
  build(1, 1, n);
  pa[1] = -1;
  DFS(1);
  travel(1);
  for (int i = 1; i < n + 1; i++) printf("%d ", ans[i]);
}
