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;
vector<int> edges[110000];
pair<int, int> blocks[110000];
vector<int> l;
void dfs(int a, int par) {
  blocks[a].first = l.size();
  l.push_back(a);
  for (int v : edges[a]) {
    if (v != par) {
      dfs(v, a);
    }
  }
  blocks[a].second = l.size() - 1;
}
int n, m;
int s;
int groups;
int b;
int cnt[110000];
int minv[1000];
int minc[1000];
int lazy[1000];
int zeroes[110000];
void upd(int a, int b, int val) {
  int k = a / s;
  if (k == b / s) {
    if (a + (s - 1) == b) {
      minv[k] += val;
      lazy[k] += val;
    } else {
      for (int j = a; j <= b; j++) {
        cnt[j] += val;
      }
      for (int j = s * k; j < s * (k + 1) && j < n; j++) {
        cnt[j] += lazy[k];
      }
      lazy[k] = 0;
      minv[k] = cnt[s * k];
      for (int j = s * k; j < s * (k + 1) && j < n; j++) {
        minv[k] = min(minv[k], cnt[j]);
      }
      minc[k] = 0;
      for (int j = s * k; j < s * (k + 1) && j < n; j++) {
        if (cnt[j] == minv[k]) minc[k]++;
      }
    }
    return;
  }
  upd(a, (a / s + 1) * s - 1, val);
  upd((a / s + 1) * s, b, val);
  return;
}
int numzero() {
  int ans = 0;
  for (int j = 0; j < groups; j++) {
    if (minv[j] == 0) {
      ans += minc[j];
    }
  }
  return ans;
}
vector<pair<int, int> > intervals[110000];
vector<pair<int, int> > actions[110000];
int main() {
  scanf("%d%d", &n, &m);
  s = sqrt(n) + 1;
  groups = (n - 1) / s + 1;
  for (int i = 0; i < n; i++) {
    cnt[i] = zeroes[i] = 0;
  }
  for (int i = 0; i < groups; i++) {
    minv[i] = 0;
    lazy[i] = 0;
    minc[i] = min(s, n - i * s);
  }
  for (int j = 0; j < n - 1; j++) {
    int u, v;
    scanf("%d%d", &u, &v);
    edges[u - 1].push_back(v - 1);
    edges[v - 1].push_back(u - 1);
  }
  dfs(0, -1);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    pair<int, int> da = blocks[a];
    pair<int, int> db = blocks[b];
    if (a == 0 || b == 0) {
    }
    if (da.second < db.first) {
      intervals[i].push_back(da);
      intervals[i].push_back(db);
    } else if (db.second < da.first) {
      intervals[i].push_back(db);
      intervals[i].push_back(da);
    } else if (db.second <= da.second && db.first >= da.first) {
      intervals[i].push_back(da);
    } else {
      intervals[i].push_back(db);
    }
    for (int j = 0; j < intervals[i].size(); j++) {
      actions[intervals[i][j].first].push_back(make_pair(i, 1));
      actions[intervals[i][j].second + 1].push_back(make_pair(i, -1));
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < actions[i].size(); j++) {
      int v = actions[i][j].first;
      for (int k = 0; k < intervals[v].size(); k++) {
        upd(intervals[v][k].first, intervals[v][k].second,
            actions[i][j].second);
      }
    }
    zeroes[l[i]] = numzero();
  }
  for (int j = 0; j < n; j++) {
    printf("%d ", max(0, n - 1 - zeroes[j]));
  }
  printf("\n");
}
