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;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int ts, kk = 1;
int n, m, sp;
vector<int> al[55];
int e[55][55];
int fr[55];
int dfs(int par, int u) {
  int rs = fr[u];
  int i;
  for (i = 0; i < al[u].size(); i++) {
    int v = al[u][i];
    if (v != par) rs += dfs(u, v);
  }
  return rs;
}
long long int p[52][52][52][52];
long long int dp(int par, int u, int q1, int q2) {
  if (al[u].size() == 1) q2 = 0;
  long long int &pr = p[par][u][q1][q2];
  if (pr != -1) return pr;
  if (q1 + q2 == 0) return pr = 0;
  pr = (1LL << 60);
  if (al[u].size() == 1) return pr = dp(u, par, 0, q1) + e[u][par];
  int i, j, k;
  long long int nw[q2 + 1], res = 0;
  long long int pq[2][q2 + 1];
  bool g = 0;
  bool fs = 0;
  for (i = 0; i < al[u].size(); i++) {
    int v = al[u][i];
    if (v == par) continue;
    if (!fs) {
      pq[g][0] = (1LL << 60);
      for (j = 1; j < q2 + 1; j++)
        pq[g][j] = dp(u, v, q1 + q2 - j, j) + e[u][v];
    } else {
      g ^= 1;
      nw[0] = (1LL << 60);
      for (j = 1; j < q2 + 1; j++) nw[j] = dp(u, v, q1 + q2 - j, j) + e[u][v];
      for (k = 0; k < q2 + 1; k++) {
        pq[g][k] = 0;
        for (j = 0; j < k + 1; j++) {
          pq[g][k] = max(pq[g][k], min(nw[j], pq[g ^ 1][k - j]));
        }
      }
    }
    fs = 1;
  }
  return pr = pq[g][q2];
}
int main() {
  int t, i, j, k;
  memset(p, -1, sizeof(p));
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d%d%d", &j, &k, &t);
    al[j].push_back(k);
    al[k].push_back(j);
    e[j][k] = e[k][j] = t;
  }
  int sp;
  scanf("%d%d", &sp, &m);
  for (i = 0; i < m; i++) scanf("%d", &k), fr[k]++;
  long long int rs = (1LL << 60);
  for (i = 0; i < al[sp].size(); i++) {
    int v = al[sp][i];
    int cnt = dfs(sp, v);
    if (cnt) rs = min(rs, dp(sp, v, m - cnt, cnt) + e[sp][v]);
  }
  printf("%lld\n", rs);
  return 0;
}