Problem: Mayor of city M. decided to launch several new metro lines during 2020. Since the city has a very limited budget, it was decided not to dig new tunnels but to use the existing underground network.

The tunnel system of the city M. consists of n metro stations. The stations are connected with n - 1 bidirectional tunnels. Between every two stations v and u there is exactly one simple path. Each metro line the mayor wants to create is a simple path between stations a_i and b_i. Metro lines can intersects freely, that is, they can share common stations or even common tunnels. However, it's not yet decided which of two directions each line will go. More precisely, between the stations a_i and b_i the trains will go either from a_i to b_i, or from b_i to a_i, but not simultaneously.

The city M uses complicated faring rules. Each station is assigned with a positive integer c_i — the fare zone of the station. The cost of travel from v to u is defined as c_u - c_v roubles. Of course, such travel only allowed in case there is a metro line, the trains on which go from v to u. Mayor doesn't want to have any travels with a negative cost, so it was decided to assign directions of metro lines and station fare zones in such a way, that fare zones are strictly increasing during any travel on any metro line.

Mayor wants firstly assign each station a fare zone and then choose a lines direction, such that all fare zones are increasing along any line. In connection with the approaching celebration of the day of the city, the mayor wants to assign fare zones so that the maximum c_i will be as low as possible. Please help mayor to design a new assignment or determine if it's impossible to do. Please note that you only need to assign the fare zones optimally, you don't need to print lines' directions. This way, you solution will be considered correct if there will be a way to assign directions of every metro line, so that the fare zones will be strictly increasing along any movement of the trains.

Input

The first line contains an integers n, m (2 ≤ n, ≤ 500 000,\ 1 ≤ m ≤ 500 000) — the number of stations in the city and the number of metro lines.

Each of the following n-1 lines describes another metro tunnel. Each tunnel is described with integers v_i, u_i (1 ≤ v_i,\ u_i ≤ n, v_i ≠ u_i). It's guaranteed, that there is exactly one simple path between any two stations.

Each of the following m lines describes another metro line. Each line is described with integers a_i, b_i (1 ≤ a_i,\ b_i ≤ n, a_i ≠ b_i).

Output

In the first line print integer k — the maximum fare zone used.

In the next line print integers c_1, c_2, …, c_n (1 ≤ c_i ≤ k) — stations' fare zones. 

In case there are several possible answers, print any of them. In case it's impossible to assign fare zones, print "-1".

Examples

Input


3 1
1 2
2 3
1 3


Output


3
1 2 3


Input


4 3
1 2
1 3
1 4
2 3
2 4
3 4


Output


-1


Input


7 5
3 4
4 2
2 5
5 1
2 6
4 7
1 3
6 7
3 7
2 1
3 6


Output


-1

Note

In the first example, line 1 → 3 goes through the stations 1, 2, 3 in this order. In this order the fare zones of the stations are increasing. Since this line has 3 stations, at least three fare zones are needed. So the answer 1, 2, 3 is optimal.

In the second example, it's impossible to assign fare zones to be consistent with a metro lines.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
template <class T>
T gcd(T a, T b) {
  return !b ? a : gcd(b, a % b);
}
template <class T>
inline void umin(T &x, T y) {
  x = x < y ? x : y;
}
template <class T>
inline void umax(T &x, T y) {
  x = x > y ? x : y;
}
inline unsigned int R() {
  static unsigned int seed = 416;
  return seed ^= seed >> 5, seed ^= seed << 17, seed ^= seed >> 13;
}
const int N = 500500;
int n, m, fa[N][20], dep[N], bj[N];
vector<int> e[N];
void GG() {
  puts("-1");
  exit(0);
}
void dfs1(int u, int Fa, int Dep) {
  fa[u][0] = Fa;
  dep[u] = Dep;
  for (int v : e[u])
    if (v != Fa) dfs1(v, u, Dep + 1);
}
int kthfa(int u, int del) {
  for (register int i = (19); i >= (0); i--)
    if (del >> i & 1) u = fa[u][i];
  return u;
}
int getlca(int u, int v) {
  if (dep[u] < dep[v]) swap(u, v);
  int del = dep[u] - dep[v];
  for (register int i = (19); i >= (0); i--)
    if (del >> i & 1) u = fa[u][i];
  if (u == v) return u;
  for (register int i = (19); i >= (0); i--)
    if (fa[u][i] != fa[v][i]) u = fa[u][i], v = fa[v][i];
  return fa[u][0];
}
vector<pair<int, int> > cons[N];
int dfn[N], num, col[N];
vector<int> d;
vector<vector<int> > f[N];
void getcol(int u, int c, int tar) {
  col[u] = c;
  d.push_back(u);
  for (auto x : cons[u])
    if (dfn[x.first] == tar)
      if (col[x.first] == -1)
        getcol(x.first, c ^ x.second, tar);
      else if (col[x.first] != (col[u] ^ x.second))
        GG();
}
void dfs2(int u, int Fa) {
  for (int v : e[u])
    if (v != Fa) dfs2(v, u), bj[u] += bj[v];
  if (bj[u])
    cons[u].push_back(make_pair(Fa, 0)), cons[Fa].push_back(make_pair(u, 0));
  vector<int> dot;
  dfn[u] = u, dot.push_back(u);
  for (int v : e[u])
    if (v != Fa) dfn[v] = u, dot.push_back(v);
  for (int x : dot) col[x] = -1;
  for (int x : dot)
    if (col[x] == -1) {
      d.clear();
      getcol(x, 0, u);
      f[u].push_back(d);
    }
}
int mid;
bool gg;
int dp[N], ans[N];
void upd(pair<int, int> &s, pair<int, int> a) {
  s = make_pair(max(s.first, a.first), min(s.second, a.second));
}
void dfs(int u, int Fa) {
  if (gg) return;
  for (int v : e[u])
    if (v != Fa) dfs(v, u);
  pair<int, int> jiao(0, mid - (Fa > 0)), sub(mid / 2 + 1, mid / 2);
  for (int x : f[u][0])
    if (x != u) {
      if (col[x] == 0)
        umax(jiao.first, dp[x]);
      else
        umin(jiao.second, mid - dp[x] - 1);
    }
  for (auto a : f[u])
    if (a[0] != f[u][0][0]) {
      int l = 0, r = 0;
      for (int x : a)
        if (col[x] == 0)
          umax(l, dp[x]);
        else
          umax(r, dp[x]);
      if (l > r) swap(l, r);
      upd(jiao, make_pair(l, mid - 1 - l));
      if (mid - r <= r - 1) {
        if (sub.first <= sub.second)
          umax(sub.second, r - 1), umin(sub.first, mid - r);
        else
          sub = make_pair(mid - r, r - 1);
      }
    }
  dp[u] = -1;
  if (jiao.first <= jiao.second) {
    if (sub.first > sub.second || sub.first > jiao.first ||
        sub.second < jiao.first)
      dp[u] = jiao.first;
    else if (sub.second + 1 <= jiao.second)
      dp[u] = sub.second + 1;
  }
  if (dp[u] == -1) gg = 1;
  dp[u]++;
}
int dir[N];
void dfs3(int u, int Fa, bool rev) {
  for (int x : f[u][0])
    if (x != u) {
      dir[x] = col[x];
    }
  for (auto a : f[u])
    if (a[0] != f[u][0][0]) {
      int l = 0, r = 0;
      for (int x : a)
        if (col[x] == 0)
          umax(l, dp[x]);
        else
          umax(r, dp[x]);
      bool flag = 0;
      if (dp[u] - 1 >= l && dp[u] - 1 <= mid - 1 - r)
        flag = 0;
      else
        flag = 1;
      for (int x : a) dir[x] = col[x] ^ flag;
    }
  for (int x : e[u])
    if (x != Fa) dir[x] ^= rev;
  for (int x : e[u])
    if (x != Fa && dir[x] == 0) dfs3(x, u, 0), umax(ans[u], ans[x]);
  ans[u]++;
  for (int x : e[u])
    if (x != Fa && dir[x] == 1) umax(ans[x], ans[u]), dfs3(x, u, 1);
}
int main() {
  read(n);
  read(m);
  for (register int i = (1); i <= (n - 1); i++) {
    int u, v;
    read(u);
    read(v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs1(1, 0, 0);
  for (register int j = (1); j <= (19); j++)
    for (register int i = (1); i <= (n); i++)
      fa[i][j] = fa[fa[i][j - 1]][j - 1];
  for (register int i = (1); i <= (m); i++) {
    int u, v;
    read(u);
    read(v);
    int l = getlca(u, v), x = 0, y = 0;
    if (dep[u] > dep[l]) bj[u]++, bj[x = kthfa(u, dep[u] - dep[l] - 1)]--;
    if (dep[v] > dep[l]) bj[v]++, bj[y = kthfa(v, dep[v] - dep[l] - 1)]--;
    if (dep[u] > dep[l] && dep[v] > dep[l]) {
      cons[x].push_back(make_pair(y, 1));
      cons[y].push_back(make_pair(x, 1));
    }
  }
  dfs2(1, 0);
  int L = 1, R = n;
  while (L < R) {
    mid = (L + R) >> 1;
    gg = 0;
    dfs(1, 0);
    if (gg)
      L = mid + 1;
    else
      R = mid;
  }
  mid = L;
  gg = 0;
  dfs(1, 0);
  dfs3(1, 0, 0);
  printf("%d\n", L);
  for (register int i = (1); i <= (n); i++) printf("%d ", ans[i]);
  return 0;
}