#include<bits/stdc++.h>
using namespace std;

int main(){
	int n, x;
	cin >> n;
	cin >> x;
	int p1, m1, s1;
	
	vector <int> vecx;
	vector <int> vecs;
	
	vector <int> vecy;
	vector <int> vecm;
	
	vector <int> vecz;
	vector <int> vecp;
		
	vecx.push_back(x);
	x = vecx[0];
	
	for(int i = 0; i < n; i++){
		cin >> x;
		vecx.push_back(x);
	}
	
	int s;
	vecs.push_back(s);
	s = vecs[0];
	
	for(int i = 0; i < x; i++){
		cin >> s;
		vecs.push_back(s);
	}
	
	int y;
	vecy.push_back(y);
	y = vecy [0];
	
	for(int i = 0; i < n; i++){
		cin >> y;
		vecy.push_back(y);
	}
	
	int m;
	vecm.push_back(m);
	m = vecm[0];
	
	for(int i = 0;i < y; i++){
		cin >> m;
		vecm.push_back(m);
	}

	
	int z;
	vecz.push_back(z);
	z = vecz [0];
	
	for(int i = 0; i < n; i++){
		cin >> z;
		vecz.push_back(z);
	}
	
	int p;
	vecp.push_back(p);
	p = vecp[0];
	
	for(int i = 0; i < z; i++){
		cin >> p >> p1;
		vecp.push_back(p);
		vecp.push_back(p1);
	}

	cout << "DA" << endl << "NE" << endl << "DA" << endl << "NE";
	
}