Problem: You are given a tree (a connected non-oriented graph without cycles) with vertices numbered from 1 to n, and the length of the i-th edge is wi. In the vertex s there is a policeman, in the vertices x1, x2, ..., xm (xj ≠ s) m criminals are located.

The policeman can walk along the edges with speed 1, the criminals can move with arbitrary large speed. If a criminal at some moment is at the same point as the policeman, he instantly gets caught by the policeman. Determine the time needed for the policeman to catch all criminals, assuming everybody behaves optimally (i.e. the criminals maximize that time, the policeman minimizes that time). Everybody knows positions of everybody else at any moment of time.

Input

The first line contains single integer n (1 ≤ n ≤ 50) — the number of vertices in the tree. The next n - 1 lines contain three integers each: ui, vi, wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 50) denoting edges and their lengths. It is guaranteed that the given graph is a tree.

The next line contains single integer s (1 ≤ s ≤ n) — the number of vertex where the policeman starts.

The next line contains single integer m (1 ≤ m ≤ 50) — the number of criminals. The next line contains m integers x1, x2, ..., xm (1 ≤ xj ≤ n, xj ≠ s) — the number of vertices where the criminals are located. xj are not necessarily distinct.

Output

If the policeman can't catch criminals, print single line "Terrorists win" (without quotes).

Otherwise, print single integer — the time needed to catch all criminals.

Examples

Input

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


Output

8


Input

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


Output

21

Note

In the first example one of the optimal scenarios is the following. The criminal number 2 moves to vertex 3, the criminal 4 — to vertex 4. The policeman goes to vertex 4 and catches two criminals. After that the criminal number 1 moves to the vertex 2. The policeman goes to vertex 3 and catches criminal 2, then goes to the vertex 2 and catches the remaining criminal.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 55;
int _w;
int n, s, m, x[MAXN];
int ss[680];
namespace Tree {
int head[MAXN], nxt[MAXN << 1], to[MAXN << 1], len[MAXN << 1], eidx;
void init() { memset(head, -1, sizeof head); }
void adde(int u, int v, int w) {
  to[eidx] = v, len[eidx] = w;
  nxt[eidx] = head[u], head[u] = eidx++;
  to[eidx] = u, len[eidx] = w;
  nxt[eidx] = head[v], head[v] = eidx++;
}
}  // namespace Tree
bool leaf[MAXN];
void prelude() {
  using namespace Tree;
  for (int u = 1; u <= n; ++u) {
    int d = 0;
    for (int i = head[u]; ~i; i = nxt[i]) ++d;
    leaf[u] = d == 1;
  }
}
int f[MAXN << 1][MAXN][MAXN], g[MAXN];
int knapsack(int e, int m, int k);
int dp(int e, int m, int k) {
  using namespace Tree;
  int &now = f[e][m][k];
  if (now != -1) return now;
  if (!m) return now = 0;
  if (leaf[to[e]])
    now = dp(e ^ 1, m - k, m - k) + len[e];
  else
    now = knapsack(e, m, k) + len[e];
  return now;
}
int knapsack(int e, int m, int k) {
  using namespace Tree;
  int u = to[e], fa = to[e ^ 1];
  for (int i = head[u]; ~i; i = nxt[i])
    if (to[i] != fa)
      for (int j = 1; j <= k; ++j) dp(i, m, j);
  g[0] = 1e9;
  for (int i = 1; i <= k; ++i) g[i] = -1;
  for (int i = head[u]; ~i; i = nxt[i]) {
    int v = to[i];
    if (v == fa) continue;
    for (int j = k - 1; j >= 0; --j)
      for (int kk = 1; j + kk <= k; ++kk)
        g[j + kk] = max(g[j + kk], min(g[j], dp(i, m, kk)));
  }
  return g[k];
}
int dfs(int u, int fa) {
  using namespace Tree;
  int sz = x[u];
  for (int i = head[u]; ~i; i = nxt[i])
    if (to[i] != fa) sz += dfs(to[i], u);
  return sz;
}
void solve() {
  using namespace Tree;
  int ans = 1e9;
  memset(f, -1, sizeof f);
  for (int i = head[s]; ~i; i = nxt[i]) {
    int v = to[i], sz = dfs(v, s);
    if (sz) ans = min(ans, dp(i, m, sz));
  }
  printf("%d\n", ans);
}
int main() {
  _w = scanf("%d", &n);
  Tree::init();
  for (int i = 0; i < 680; i++) {
    ss[i] = i;
  }
  for (int i = 0; i < n - 1; ++i) {
    int u, v, w;
    _w = scanf("%d%d%d", &u, &v, &w);
    Tree::adde(u, v, w);
  }
  _w = scanf("%d%d", &s, &m);
  for (int i = 0; i < m; ++i) {
    int y;
    _w = scanf("%d", &y);
    ++x[y];
  }
  prelude(), solve();
  return 0;
}