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 <class T, class L>
T &smax(T &x, L y) {
  if (y > x) x = y;
  return x;
}
template <class T, class L>
T &smin(T &x, L y) {
  if (y < x) x = y;
  return x;
}
const int maxn = 1e5 + 17;
struct node {
  int m, n;
} s[maxn << 2], i17 = {1717171717, 0};
node operator&(const node &a, const node &b) {
  if (a.m < b.m) return a;
  if (b.m < a.m) return b;
  return {a.m, a.n + b.n};
}
vector<int> g[maxn], q[maxn];
int n, m, ans[maxn], st[maxn], en[maxn], Time, lazy[maxn << 2], cur, a[maxn];
void shift(int id) {
  if (!lazy[id]) return;
  lazy[id << 1] += lazy[id], lazy[id << 1 | 1] += lazy[id];
  s[id << 1].m += lazy[id];
  s[id << 1 | 1].m += lazy[id];
  lazy[id] = 0;
}
node get(int st, int en, int l = 0, int r = n, int id = 1) {
  if (en <= l || r <= st) return i17;
  if (st <= l && r <= en) return s[id];
  shift(id);
  int mid = (l + r) >> 1;
  return get(st, en, l, mid, id << 1) & get(st, en, mid, r, id << 1 | 1);
}
void add(int st, int en, int v = 1, int l = 0, int r = n, int id = 1) {
  if (en <= l || r <= st) return;
  if (st <= l && r <= en) {
    s[id].m += v;
    lazy[id] += v;
    return;
  }
  shift(id);
  int mid = (l + r) >> 1;
  add(st, en, v, l, mid, id << 1);
  add(st, en, v, mid, r, id << 1 | 1);
  s[id] = s[id << 1] & s[id << 1 | 1];
}
void build(int l = 0, int r = n, int id = 1) {
  s[id].n = r - l;
  int mid = (l + r) >> 1;
  if (r - l > 1) build(l, mid, id << 1), build(mid, r, id << 1 | 1);
}
int z(int l, int r) {
  node tmp = get(l, r);
  if (!tmp.m) return tmp.n;
  return 0;
}
void dfs(int v = 0, int p = -1) {
  if (q[v].size()) cur += z(st[v], en[v]), add(st[v], en[v]);
  for (auto &u : q[v]) {
    cur += z(st[u], en[u]);
    add(st[u], en[u]);
  }
  ans[v] = cur;
  for (auto &u : g[v])
    if (u != p) dfs(u, v);
  if (q[v].size()) add(st[v], en[v], -1), cur -= z(st[v], en[v]);
  for (auto &u : q[v]) {
    add(st[u], en[u], -1);
    cur -= z(st[u], en[u]);
  }
}
void sten(int v = 0, int p = -1) {
  st[v] = Time++;
  for (auto &u : g[v])
    if (u != p) sten(u, v);
  en[v] = Time;
}
int main() {
  cin >> n >> m;
  for (int i = 1, v, u; i < n; i++)
    cin >> v >> u, g[--v].push_back(--u), g[u].push_back(v);
  while (m--) {
    int v, u;
    cin >> v >> u;
    q[--v].push_back(--u), q[u].push_back(v);
  }
  build();
  sten();
  dfs();
  for_each(ans, ans + n, [](int &x) { cout << (x ? x - 1 : 0) << ' '; });
  cout << '\n';
  return 0;
}
