Problem: There are n cities in the country of Berland. Some of them are connected by bidirectional roads in such a way that there exists exactly one path, which visits each road no more than once, between every pair of cities. Each road has its own length. Cities are numbered from 1 to n.

The travelling time between some cities v and u is the total length of the roads on the shortest path from v to u. 

The two most important cities in Berland are cities 1 and n.

The Berland Ministry of Transport decided to build a single new road to decrease the traffic between the most important cities. However, lots of people are used to the current travelling time between the most important cities, so the new road shouldn't change it too much. 

The new road can only be built between such cities v and u that v ≠ u and v and u aren't already connected by some road.

They came up with m possible projects. Each project is just the length x of the new road.

Polycarp works as a head analyst at the Berland Ministry of Transport and it's his job to deal with all those m projects. For the i-th project he is required to choose some cities v and u to build the new road of length x_i between such that the travelling time between the most important cities is maximal possible. 

Unfortunately, Polycarp is not a programmer and no analyst in the world is capable to process all projects using only pen and paper. 

Thus, he asks you to help him to calculate the maximal possible travelling time between the most important cities for each project. Note that the choice of v and u can differ for different projects.

Input

The first line contains two integers n and m (3 ≤ n ≤ 3 ⋅ 10^5, 1 ≤ m ≤ 3 ⋅ 10^5) — the number of cities and the number of projects, respectively.

Each of the next n - 1 lines contains three integers v_i, u_i and w_i (1 ≤ v_i, u_i ≤ n, 1 ≤ w_i ≤ 10^9) — the description of the i-th road. It is guaranteed that there exists exactly one path, which visits each road no more than once, between every pair of cities.

Each of the next m lines contains a single integer x_j (1 ≤ x_j ≤ 10^9) — the length of the road for the j-th project.

Output

Print m lines, the j-th line should contain a single integer — the maximal possible travelling time between the most important cities for the j-th project.

Example

Input

7 2
1 2 18
2 3 22
3 4 24
4 7 24
2 6 4
3 5 12
1
100


Output

83
88

Note

The road network from the first example:

<image>

You can build the road with length 1 between cities 5 and 6 to get 83 as the travelling time between 1 and 7 (1 → 2 → 6 → 5 → 3 → 4 → 7 = 18 + 4 + 1 + 12 + 24 + 24 = 83). Other possible pairs of cities will give answers less or equal to 83.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int)1e9 + 23111992;
const long long LINF = (long long)1e18 + 23111992;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return val < a ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
inline long long isqrt(long long k) {
  long long r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
inline long long icbrt(long long k) {
  long long r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(long double x, long double y) { return sign(x - y); }
template <class T>
struct SegmenTree {
  static const int maxn = 3e5 + 5;
  T st[maxn << 2];
  T lz[maxn << 2];
  void upd(int p, int i, int L, int R, T val) {
    if (i < L || R < i) return;
    if (L == R) {
      st[p] = val;
      return;
    }
    upd(p << 1, i, L, L + R >> 1, val);
    upd(p << 1 | 1, i, (L + R >> 1) + 1, R, val);
    st[p] = max(st[p << 1], st[p << 1 | 1]);
  }
  T query(int p, int l, int r, int L, int R) {
    if (r < L || R < l) return -LINF;
    if (l <= L && R <= r) return st[p];
    return max(query(p << 1, l, r, L, L + R >> 1),
               query(p << 1 | 1, l, r, (L + R >> 1) + 1, R));
  }
};
SegmenTree<long long> seg[2];
const int maxn = 3e5 + 5;
int n, m;
vector<pair<int, int> > adj[maxn];
long long a[maxn];
long long b[maxn];
int idx[maxn];
void dfs(int u, int p, long long d[]) {
  for (pair<int, int> e : adj[u]) {
    int v = e.first;
    int w = e.second;
    if (v != p) {
      d[v] = d[u] + w;
      dfs(v, u, d);
    }
  }
}
void chemthan() {
  cin >> n >> m;
  for (int i = (0); i < (n - 1); ++i) {
    int u, v, w;
    cin >> u >> v >> w;
    u--, v--;
    adj[u].push_back(make_pair(v, w));
    adj[v].push_back(make_pair(u, w));
  }
  dfs(0, -1, a), dfs(n - 1, -1, b);
  vector<int> ver;
  for (int i = (0); i < (n); ++i) ver.push_back(i);
  sort((ver).begin(), (ver).end(), [&](int u, int v) {
    return make_pair(a[u] - b[u], u) < make_pair(a[v] - b[v], v);
  });
  for (int i = (0); i < (n); ++i) {
    idx[ver[i]] = i;
  }
  for (int u = (0); u < (n); ++u) {
    seg[0].upd(1, idx[u], 0, n - 1, a[u]);
    seg[1].upd(1, idx[u], 0, n - 1, b[u]);
  }
  long long mx = 0;
  for (int u = (0); u < (n); ++u) {
    for (pair<int, int> e : adj[u]) {
      int v = e.first;
      seg[0].upd(1, idx[v], 0, n - 1, -LINF);
      seg[1].upd(1, idx[v], 0, n - 1, -LINF);
    }
    long long t1 = a[u] + seg[1].query(1, idx[u] + 1, n - 1, 0, n - 1);
    long long t2 = b[u] + seg[0].query(1, 0, idx[u] - 1, 0, n - 1);
    chkmax(mx, max(t1, t2));
    for (pair<int, int> e : adj[u]) {
      int v = e.first;
      seg[0].upd(1, idx[v], 0, n - 1, a[v]);
      seg[1].upd(1, idx[v], 0, n - 1, b[v]);
    }
  }
  for (int i = (0); i < (m); ++i) {
    int x;
    cin >> x;
    cout << min(a[n - 1], mx + x) << "\n";
  }
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0), cin.tie(0);
  if (argc > 1) {
    assert(freopen(argv[1], "r", stdin));
  }
  if (argc > 2) {
    assert(freopen(argv[2], "wb", stdout));
  }
  chemthan();
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}