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;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T, class T1>
inline void gn(T &first, T1 &second) {
  gn(first);
  gn(second);
}
template <class T, class T1, class T2>
inline void gn(T &first, T1 &second, T2 &z) {
  gn(first);
  gn(second);
  gn(z);
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
template <class T>
inline void printsp(T first) {
  print(first);
  putchar(' ');
}
template <class T>
inline void println(T first) {
  print(first);
  putchar('\n');
}
template <class T, class U>
inline void print(T first, U second) {
  printsp(first);
  println(second);
}
template <class T, class U, class V>
inline void print(T first, U second, V z) {
  printsp(first);
  printsp(second);
  println(z);
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
vector<int> adj[101111];
vector<pair<int, int> > seg[101111];
int L[101111], R[101111];
int rid;
int ans[101111];
int n, m;
int mn[101111 << 2];
int flag[101111 << 2];
int cnt[101111 << 2];
void push_up(int u) {
  cnt[u] = 0;
  if (mn[(u << 1)] <= mn[((u << 1) | 1)]) cnt[u] += cnt[(u << 1)];
  if (mn[(u << 1)] >= mn[((u << 1) | 1)]) cnt[u] += cnt[((u << 1) | 1)];
  mn[u] = min(mn[(u << 1)], mn[((u << 1) | 1)]);
}
void push_down(int u) {
  if (flag[u] == 0) return;
  flag[(u << 1)] += flag[u];
  flag[((u << 1) | 1)] += flag[u];
  mn[(u << 1)] += flag[u];
  mn[((u << 1) | 1)] += flag[u];
  flag[u] = 0;
  return;
}
void build(int u, int st, int ed) {
  if (ed == st + 1) {
    cnt[u] = 1;
    return;
  }
  build((u << 1), st, (st + ed >> 1));
  build(((u << 1) | 1), (st + ed >> 1), ed);
  push_up(u);
}
void update(int u, int st, int ed, int l, int r, int d) {
  smax(l, st);
  smin(r, ed);
  if (l >= r) return;
  if (l == st and r == ed) {
    mn[u] += d;
    flag[u] += d;
    return;
  }
  push_down(u);
  update((u << 1), st, (st + ed >> 1), l, r, d);
  update(((u << 1) | 1), (st + ed >> 1), ed, l, r, d);
  push_up(u);
}
int calc(int u, int st, int ed) {
  if (mn[u] == 0) {
    return ed - st - cnt[u];
  } else {
    return ed - st;
  }
}
void dfs(int u, int fa = 0) {
  L[u] = ++rid;
  for (int i = 0; i < ((int)adj[u].size()); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    dfs(v, u);
  }
  R[u] = rid;
}
void solve(int u, int fa = 0) {
  for (int i = 0; i < ((int)seg[u].size()); i++) {
    update(1, 1, n + 1, seg[u][i].first, seg[u][i].second + 1, 1);
  }
  ans[u] = calc(1, 1, n + 1);
  for (int i = 0; i < ((int)adj[u].size()); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    solve(v, u);
  }
  for (int i = 0; i < ((int)seg[u].size()); i++) {
    update(1, 1, n + 1, seg[u][i].first, seg[u][i].second + 1, -1);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    int u, v;
    gn(u, v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1);
  for (int i = 0; i < m; i++) {
    int u, v;
    gn(u, v);
    seg[u].push_back(pair<int, int>(L[u], R[u]));
    seg[u].push_back(pair<int, int>(L[v], R[v]));
    seg[v].push_back(pair<int, int>(L[u], R[u]));
    seg[v].push_back(pair<int, int>(L[v], R[v]));
  }
  build(1, 1, n + 1);
  solve(1);
  for (int i = 1; i <= n; i++) printsp(max(0, ans[i] - 1));
  puts("");
  return 0;
}
