#include <iostream>
#include<algorithm>
#include <vector>
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;
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 >> v >> u;
int idx=edge[v-1].se, idx2=edge[v-1].fi;
if(in[u]>=in[idx] && out[u]<=out[idx] && in[u]>=in[idx2] && out[u]<=out[idx2])
cout << 0;
else
cout << "escaped";
cout << endl;
}
return 0;
}