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>
const int N = 500054, M = N * 2, LN = 20;
int n, m, E = 0;
int to[M], first[N], next[M];
int P[LN][N], *p = *P, dep[N];
int cnt = 0, o[N], id[N], eid[N];
int cong[N], bel[M];
inline void up(int &x, const int y) { x < y ? x = y : 0; }
inline void down(int &x, const int y) { x > y ? x = y : 0; }
inline int min(const int x, const int y) { return x < y ? x : y; }
inline int max(const int x, const int y) { return x < y ? y : x; }
inline void addedge(int u, int v) {
  to[++E] = v, next[E] = first[u], first[u] = E;
  to[++E] = u, next[E] = first[v], first[v] = E;
}
void dfs(int x) {
  int i, y;
  o[++cnt] = x, id[x] = cnt;
  for (i = 0; P[i][x]; ++i) P[i + 1][x] = P[i][P[i][x]];
  for (i = first[x]; i; i = next[i])
    if ((y = to[i]) != p[x]) p[y] = x, dep[y] = dep[x] + 1, dfs(y);
  eid[x] = cnt;
}
int jump_until(int x, int d) {
  int S = dep[x] - d;
  for (assert(S >= 0); S; S &= S - 1) x = P[__builtin_ctz(S)][x];
  return x;
}
namespace dsu {
int p[M];
int ancestor(int x) { return p[x] == x ? x : (p[x] = ancestor(p[x])); }
inline bool test(int x, int y, bool un = false) {
  if ((x = ancestor(x)) == (y = ancestor(y))) return true;
  return un && (p[x] = y, false);
}
inline void equiv(int x, int y) {
  test(x, y, true), test(((((x)-1) ^ 1) + 1), ((((y)-1) ^ 1) + 1), true);
}
inline void init(int n) { std::iota(p, p + ++n, 0); }
}  // namespace dsu
namespace dp {
int f[N], stamp[N], li[N];
int l[N], r[N];
bool contain[N], rev[N];
bool main(int R) {
  int i, x, y, cl, cr, cc, B, at, bt, top, _;
  bool Lr, Rr;
  memset(stamp, 0, (n + 1) << 2);
  for (_ = n; _; --_) {
    x = o[_], top = 0, cl = 1, cr = R, cc = (R + 1) / 2;
    for (i = first[x]; i; i = next[i]) {
      y = to[i], B = bel[(2 * (y)-1)], at = (B + 1) / 2;
      if (stamp[at] != _) stamp[at] = _, l[at] = 1, r[at] = R, li[top++] = at;
      B & 1 ? up(l[at], f[y] + 1) : down(r[at], R - f[y]);
    }
    B = bel[(2 * (x)-1)], bt = (B + 1) / 2;
    for (i = 0; i < top; ++i) {
      if (y = li[i], l[y] > r[y]) return false;
      if (y == bt)
        B & 1 ? (up(cl, l[y]), down(cr, r[y]))
              : (up(cl, R + 1 - r[y]), down(cr, R + 1 - l[y]));
      else
        Lr = l[y] * 2 <= R + 2, Rr = r[y] * 2 >= R, assert(Lr || Rr),
        down(cc, min(r[y], R + 1 - l[y])), up(cl, min(l[y], R + 1 - r[y])),
        down(cr, max(r[y], R + 1 - l[y]));
    }
    if (cc < cl) up(cl, R + 1 - cc);
    if (cl > cr) return false;
    for (f[x] = cl, i = 0; i < top; ++i)
      y = li[i], contain[y] = (l[y] <= cl && cl <= r[y]);
    for (i = first[x]; i; i = next[i])
      y = to[i], B = bel[(2 * (y)-1)], at = (B + 1) / 2,
      rev[y] = (B ^ (at == bt ? bel[(2 * (x)-1)] : contain[at])) & 1;
  }
  return true;
}
void dump(int R) {
  int i, v;
  ++R;
  for (i = 1; i <= n; ++i) v = o[i], (rev[v] ^= rev[p[v]]) && (f[v] = R - f[v]);
  for (i = 1; i <= n; ++i) printf("%d%c", f[i], i == n ? 10 : 32);
}
}  // namespace dp
int main() {
  int i, u, v, w, x, y, L, R, M;
  scanf("%d%d", &n, &m), dsu::init(2 * n);
  for (i = 1; i < n; ++i) scanf("%d%d", &u, &v), addedge(u, v);
  for (dfs(1); m; --m) {
    scanf("%d%d", &u, &v), assert(u != v);
    if (id[u] > id[v]) std::swap(u, v);
    if (id[v] <= eid[u])
      ++cong[v], --cong[jump_until(v, dep[u] + 1)];
    else {
      w = min(dep[u], dep[v]), x = jump_until(u, w), y = jump_until(v, w);
      for (i = LN - 1; i >= 0; --i)
        if (P[i][x] != P[i][y]) x = P[i][x], y = P[i][y];
      ++cong[u], ++cong[v], --cong[x], --cong[y];
      dsu::equiv((2 * (x)-1), (2 * (y)));
    }
  }
  for (i = n; i; --i)
    if (v = o[i], cong[p[v]] += cong[v], cong[v])
      dsu::equiv((2 * (v)-1), (2 * (p[v]) - 1));
  for (i = 2; i <= n; ++i)
    if (dsu::test((2 * (i)-1), (2 * (i)))) return puts("-1"), 0;
  for (u = 1; u <= n; ++u) {
    if (to[i = first[u]] == p[u])
      first[u] = next[i];
    else
      for (i = first[u]; next[i]; i = next[i])
        if (to[next[i]] == p[u]) next[i] = next[next[i]];
    if (!bel[dsu::ancestor((2 * (u)-1))])
      bel[dsu::ancestor((2 * (u)-1))] = (2 * (u)-1);
    if (!bel[dsu::ancestor((2 * (u)))])
      bel[dsu::ancestor((2 * (u)))] = (2 * (u));
  }
  for (i = 1; i <= 2 * n; ++i) bel[i] = bel[dsu::ancestor(i)];
  for (L = 1, R = n; L < R; dp::main(M = (L + R) / 2) ? R = M : L = M + 1)
    ;
  return printf("%d\n", L), dp::main(L), dp::dump(L), 0;
}