#include <iostream>
#include <vector>
using namespace std;
vector <int> firm[10001];
bool badTable[10001];
bool find ( int src ) {
if ( badTable[src] )
return true;
for ( int i = 0; i < firm[src].size(); ++i )
if ( find ( firm[src][i] ) )
return true;
return false;
}
int main() {
int N, M, L, Q, a, b, no, src;
cin >> N >> M >> L >> Q;
for ( int i = 1; i <= M; ++i ) {
cin >> a >> b;
firm[b].push_back ( a );
}
for ( int i = 1; i <= L; ++i ) {
cin >> no;
badTable[no] = true;
}
for ( int i = 1; i <= Q; ++i ) {
cin >> src;
cout << ( find ( src ) ? "TUIHUOOOOOO" : "YA~~" ) << endl;
}
}