#include <bits/stdc++.h>
using namespace std;
const int M = 120;
int fi[M], to[M], from[M], ne[M], la[M], c[M], tot, cnt[M], leaf[M],
    f[M][51][51];
int x, n, m, s, u, v, w, ans;
void Add(int x, int y, int z) {
  to[++tot] = y;
  from[tot] = x;
  c[tot] = z;
  !fi[x] ? fi[x] = tot : ne[la[x]] = tot;
  la[x] = tot;
}
void Dfs(int x, int fa) {
  for (int i = fi[x]; i; i = ne[i]) {
    int v = to[i];
    if (v == fa) continue;
    Dfs(v, x);
    cnt[x] += cnt[v];
  }
}
int Solve(int e, int all, int now) {
  int &fvl = f[e][all][now];
  if (fvl != -1) return fvl;
  if (all == 0) return 0;
  if (leaf[to[e]]) return fvl = Solve(e ^ 1, all - now, all - now) + c[e];
  int l = 1, r = 0x3f3f3f3f, ans = 0, u = from[e], v = to[e];
  while (l < r) {
    int mid = (l + r) >> 1;
    int sum = 0;
    for (int i = fi[v], j; i; i = ne[i]) {
      if (to[i] == u) continue;
      for (j = 1; j <= now; j++) {
        if (Solve(i, all, j) <= mid) break;
      }
      sum += j - 1;
      if (sum >= now) break;
    }
    if (sum >= now)
      l = mid + 1;
    else
      r = mid;
  }
  return fvl = l + c[e];
}
int main() {
  scanf("%d", &n);
  tot = 1;
  for (int i = 1; i < n; i++) {
    scanf("%d%d%d", &u, &v, &w);
    Add(u, v, w);
    Add(v, u, w);
  }
  memset(f, 0xff, sizeof(f));
  scanf("%d%d", &s, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &x);
    cnt[x]++;
  }
  int ans = 0x3f3f3f3f;
  Dfs(s, 0);
  for (int i = 1; i <= n; i++) {
    if (ne[fi[i]] == 0) leaf[i] = 1;
  }
  for (int i = fi[s]; i; i = ne[i]) {
    if (!cnt[to[i]]) continue;
    ans = min(ans, Solve(i, m, cnt[to[i]]));
  }
  if (ans > 1e9)
    printf("Terrorists win\n");
  else
    printf("%d\n", ans);
}
