#include <bits/stdc++.h>
#define endl '\n'
#define fi first
#define se second
#define eb emplace_back
#define pb push_back
#define ALL(A) A.begin(), A.end()
#define FOR(i, l, r) for (int i = l; i <= r; i++)
#define FOR2(i, l, r) for (int i = l; i >= r; i--)
#define ce cout<<endl;
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
using str = string;
using T = pair<ll,int>;
const ll INF = 1e18;
const int N = 1e5;
const int LOG2 = 17;
const int inv = 1112;
const int MOD =998244353 ;
int dx[]= {0,0,-1,1};
int dy[] = {1 , - 1 , 0 , 0};
// Author : T_Danh - Tri An High School
ll mypow(ll a, ll b , ll mod ){
ll res = 1;
a %= mod;
while(b){
if(b & 1) res = res * a % mod;
a = a * a % mod;
b >>= 1;
}
return res;
}
vector<pair<int,ll>> adj[N + 1];
pii E[N + 1];
ll dp[N + 1] , d[N + 1];
bool shop[N + 1];
int par[N + 1][LOG2 ] , in[N + 1], out[N + 1], timer = 0;
ll mn[N + 1][LOG2 ] , x[N + 1];
int n , s , q , e;
void dfs(int u , int p){
par[u][0] = p;
in[u] = ++timer;
x[u] = INF;
if(shop[u]){
x[u] = d[u];
}
for(pair<int,ll>& to : adj[u]) if(to.fi != p){
d[to.fi] = d[u] + to.se;
dfs(to.fi , u);
x[u]= min(x[u] , x[to.fi]);
}
dp[u] = (x[u] == INF ? INF : x[u] - 2 * d[u]);
mn[u][0] = dp[u];
out[u] = timer;
}
bool is_ancestor(int u , int v){
return in[u] <= in[v] && out[v] <= out[u];
}
void solve() {
cin >> n >> s >> q >> e;
FOR(i,1,n) dp[i] = INF;
FOR(i,1,n - 1){
int a , b;
ll w;
cin >> a >> b >> w;
E[i] = {a , b};
adj[a].eb(b , w);
adj[b].eb(a , w);
}
FOR(i,1,s){
int x;
cin >> x;
shop[x] = true;
}
dfs(e , e);
for(int j = 1 ; j < LOG2 ; ++j){
for(int i = 1 ; i <= n ; ++i){
par[i][j] = par[par[i][j - 1]][j - 1];
mn[i][j] = min(mn[i][j - 1], mn[par[i][j - 1]][j - 1]);
}
}
while(q--){
int i , r;
cin >> i >> r;
int u = E[i].fi , v = E[i].se;
if(is_ancestor(u , v)){
swap(u , v);
}
if(!is_ancestor(u , r)){
cout << "escaped" <<endl;
continue;
}
ll best = dp[r] , dd = d[r];
for(int j = LOG2 - 1 ; j >= 0 ; j--){
if(is_ancestor(u ,par[r][j] )){
if(r == 5){
cout << j <<endl;
}
best = min(best , mn[r][j ]);
r = par[r][j];
}
}
best = min(best , dp[r]) ;
if(best == INF){
cout << "oo" <<endl;
continue;
}
ll res = best + dd;
cout << res <<endl;
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
#define NAME "odometer"
if (fopen(NAME".in", "r"))
freopen(NAME".in", "r", stdin),
freopen(NAME".out", "w", stdout);
int t = 1;
while (t--) {
solve();
}
return 0;
}