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;
bool home = 1;
signed realMain();
signed main() {
  home = 0;
  if (home) {
    freopen("tony_stark", "r", stdin);
  } else {
    ios::sync_with_stdio(0);
    cin.tie(0);
  }
  realMain();
}
const long long N = 50 + 7;
const long long INF = (long long)1e9;
long long n, m, from[2 * N], to[2 * N], dur[2 * N], start;
long long dp[2 * N][N][N];
vector<long long> g[N];
void add(long long i, long long j, long long take) {
  from[m] = i;
  to[m] = j;
  dur[m] = take;
  g[i].push_back(m);
  m++;
}
long long rec(long long edge, long long total, long long sub) {
  if (total == 0) return 0;
  if (dp[edge][total][sub] != -1) return dp[edge][total][sub];
  if ((long long)g[to[edge]].size() == 1) {
    dp[edge][total][sub] = rec(edge ^ 1, total - sub, total - sub) + dur[edge];
    return dp[edge][total][sub];
  }
  long long sol = INF;
  long long lo = 0, hi = INF;
  bool ok = (edge == 1 && total == 4 && sub == 4);
  while (lo <= hi) {
    long long t = (lo + hi) / 2;
    long long cntmin = 0;
    long long nr = (long long)g[to[edge]].size() - 1;
    for (auto &edge2 : g[to[edge]]) {
      if (edge2 == (edge ^ 1)) continue;
      for (long long need = sub; need >= 1; need--) {
        if (rec(edge2, total, need) > t) {
          cntmin += need;
          break;
        }
      }
    }
    bool castig_eu = (cntmin < sub);
    if (castig_eu) {
      sol = t;
      hi = t - 1;
    } else {
      lo = t + 1;
    }
  }
  sol += dur[edge];
  dp[edge][total][sub] = sol;
  return sol;
}
long long este[N];
long long calc_sub(long long a, long long p = -1) {
  long long sol = este[a];
  for (auto &ind : g[a]) {
    long long b = to[ind];
    if (b != p) sol += calc_sub(b, a);
  }
  return sol;
}
signed realMain() {
  for (long long i = 0; i < 2 * N; i++)
    for (long long j = 0; j < N; j++)
      for (long long k = 0; k < N; k++) dp[i][j][k] = -1;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long x, y, take;
    cin >> x >> y >> take;
    add(x, y, take);
    add(y, x, take);
  }
  cin >> start;
  long long cntnodes;
  cin >> cntnodes;
  vector<long long> nodes(cntnodes);
  for (auto &x : nodes) cin >> x;
  for (auto &x : nodes) este[x]++;
  long long ret = INF;
  for (auto &ind : g[start]) {
    ret = min(ret, rec(ind, (long long)nodes.size(), calc_sub(to[ind], start)));
  }
  cout << ret << "\n";
  return 0;
}