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> e[100000];
vector<pair<int, int> > ps[100001];
vector<pair<int, int> > ms[100001];
int ans[100000];
int lft[100000];
int rht[100000];
int id[100000];
int k;
int val[1 << 20];
int upd[1 << 20];
int num[1 << 20];
int segn;
pair<int, int> min(pair<int, int> a, pair<int, int> b) { return a < b ? a : b; }
void init_dfs(int k, int l, int r) {
  upd[k] = 0;
  val[k] = 0;
  num[k] = r - l;
  if (r - l == 1) return;
  init_dfs(k * 2 + 1, l, (l + r) / 2);
  init_dfs(k * 2 + 2, (l + r) / 2, r);
}
void init(int n) {
  segn = 1;
  while (segn < n) segn *= 2;
  init_dfs(0, 0, segn);
}
int get(int v) { return val[v] + upd[v]; }
void add(int a, int b, int x, int k = 0, int l = 0, int r = segn) {
  if (r <= a || b <= l)
    return;
  else if (a <= l && r <= b)
    upd[k] += x;
  else {
    add(a, b, x, k * 2 + 1, l, (l + r) / 2);
    add(a, b, x, k * 2 + 2, (l + r) / 2, r);
    if (get(k * 2 + 1) == get(k * 2 + 2)) {
      val[k] = get(k * 2 + 1);
      num[k] = num[k * 2 + 1] + num[k * 2 + 2];
    } else if (get(k * 2 + 1) < get(k * 2 + 2)) {
      val[k] = get(k * 2 + 1);
      num[k] = num[k * 2 + 1];
    } else {
      val[k] = get(k * 2 + 2);
      num[k] = num[k * 2 + 2];
    }
  }
}
pair<int, int> query(int a, int b, int k = 0, int l = 0, int r = segn) {
  if (r <= a || b <= l)
    return pair<int, int>(10000000, 0);
  else if (a <= l && r <= b)
    return pair<int, int>(get(k), num[k]);
  else {
    pair<int, int> vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    pair<int, int> vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    if (vl.first == vr.first)
      return pair<int, int>(vl.first + upd[k], vl.second + vr.second);
    else if (vl.first < vr.first)
      return pair<int, int>(vl.first + upd[k], vl.second);
    else
      return pair<int, int>(vr.first + upd[k], vr.second);
  }
}
void dfs(int v, int p) {
  lft[v] = k;
  id[k++] = v;
  for (int i = 0; i < e[v].size(); i++) {
    if (e[v][i] == p) continue;
    dfs(e[v][i], v);
  }
  rht[v] = k;
}
void adq(int a, int b, int c, int d) {
  ps[a].push_back(pair<int, int>(c, d));
  ms[b].push_back(pair<int, int>(c, d));
}
int main() {
  int n, q, i, j;
  scanf("%d %d", &n, &q);
  for (i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  k = 0;
  dfs(0, -1);
  for (i = 0; i < q; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    adq(lft[a], rht[a], lft[a], rht[a]);
    adq(lft[b], rht[b], lft[b], rht[b]);
    adq(lft[a], rht[a], lft[b], rht[b]);
    adq(lft[b], rht[b], lft[a], rht[a]);
  }
  init(n);
  for (i = 0; i < n; i++) {
    for (j = 0; j < ps[i].size(); j++) add(ps[i][j].first, ps[i][j].second, 1);
    for (j = 0; j < ms[i].size(); j++) add(ms[i][j].first, ms[i][j].second, -1);
    pair<int, int> p = query(0, n);
    if (p.first == 0) {
      ans[id[i]] = n - p.second - 1;
      if (ans[id[i]] < 0) ans[id[i]] = 0;
    } else
      ans[id[i]] = n - 1;
  }
  for (i = 0; i < n; i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}
