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 L>
inline bool smax(T &x, L y) {
  return x < y ? (x = y, true) : false;
}
template <typename T, typename L>
inline bool smin(T &x, L y) {
  return y < x ? (x = y, true) : false;
}
struct node {
  int mn, cnt;
};
node operator+(const node &a, const node &b);
node operator+(const node &a, const int &b);
void build(int id, int b, int e);
void pre_dfs(int v, int par = -1);
void dfs(int v, int par = -1);
void update(int id, int b, int e, int l, int r, int v);
node val(int id);
constexpr int MAXN = 1e5 + 15;
int n, m;
vector<int> q[MAXN], adj[MAXN];
node tree[MAXN << 2];
int lz[MAXN << 2];
int ans[MAXN];
int p;
int st[MAXN], ft[MAXN];
int main() {
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    q[u].push_back(v);
    q[v].push_back(u);
  }
  pre_dfs(1);
  build(1, 0, n);
  dfs(1);
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << ' ';
  }
  return cout << '\n', false;
}
void build(int id, int b, int e) {
  if (b == e - 1) {
    tree[id].cnt = 1;
    return;
  }
  int mid = (b + e) >> 1;
  build(id << 1, b, mid);
  build(id << 1 | 1, mid, e);
  tree[id] = tree[id << 1] + tree[id << 1 | 1];
}
node operator+(const node &a, const node &b) {
  if (a.mn != b.mn) {
    if (a.mn < b.mn) {
      return a;
    }
    return b;
  }
  return {a.mn, a.cnt + b.cnt};
}
node operator+(const node &a, const int &b) { return {a.mn + b, a.cnt}; }
void update(int id, int b, int e, int l, int r, int v) {
  if (b >= r || e <= l) {
    return;
  }
  if (b >= l && e <= r) {
    lz[id] += v;
    return;
  }
  int mid = (b + e) >> 1;
  update(id << 1, b, mid, l, r, v);
  update(id << 1 | 1, mid, e, l, r, v);
  tree[id] = val(id << 1) + val(id << 1 | 1);
}
node val(int id) { return tree[id] + lz[id]; }
void pre_dfs(int v, int par) {
  st[v] = p++;
  for (auto u : adj[v]) {
    if (u != par) {
      pre_dfs(u, v);
    }
  }
  ft[v] = p;
}
void dfs(int v, int par) {
  for (auto u : q[v]) {
    update(1, 0, n, st[u], ft[u], 1);
  }
  if (q[v].size()) {
    update(1, 0, n, st[v], ft[v], 1);
  }
  ans[v] = n - 1;
  tree[1] = val(1);
  if (!tree[1].mn) {
    ans[v] -= tree[1].cnt;
  }
  smax(ans[v], 0);
  for (auto u : adj[v]) {
    if (u != par) {
      dfs(u, v);
    }
  }
  for (auto u : q[v]) {
    update(1, 0, n, st[u], ft[u], -1);
  }
  if (q[v].size()) {
    update(1, 0, n, st[v], ft[v], -1);
  }
}
