#include <iostream>
#include<algorithm>
#include <vector>
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;
const ll INF=1e18+5;
ll n, s, q, e, u, v, w;
vector<pair<int, int>>graph[100005];
vector<pair<int, int>>edge;
bool shop[100005];
int in[100005], out[100005], t, dist[100005];
void dfs(int x, int p){
in[x]=t;
t++;
for(auto y : graph[x]){
if(y.fi!=p){
dist[y.fi]=dist[x]+y.se;
dfs(y.fi, x);
}
}
out[x]=t;
}
int main()
{
//ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n >> s >> q >> e;
for(int i=1; i<n; i++){
cin >> u >> v >> w;
graph[u].pb({v, w});
graph[v].pb({u, w});
edge.pb({u, v});
}
for(int i=0; i<s; i++){
cin >> u;
shop[u]=1;
}
dfs(e, e);
while(q--){
cin >> u >> v;
int idx=edge[v-1].se;
if(dist[edge[v-1].fi]>dist[idx])
idx=edge[v-1].fi;
if(in[v]>in[idx] && out[v]<out[idx]){
cout << "escaped";
}
else
cout << 0;
cout << endl;
}
return 0;
}