#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

int diff_row_hidariue[3] = {0,1,1},diff_col_hidariue[3] = {1,0,1};
int diff_row_migiue[2] = {1,1},diff_col_migiue[2] = {-1,0};

int n,u,v,m;

struct Info{
	int row,col,value;
	bool exist,checked;
};

struct Data{
	Data(int arg_row,int arg_col){
		row = arg_row;
		col = arg_col;
	}

	int row,col;
};

bool rangeCheck(int row,int col){
	if(row >= 0 && row <= n-1 && col >= 0 && col <= n-1)return true;
	else{
		return false;
	}
}


int main(){

	scanf("%d %d %d %d",&n,&u,&v,&m);

	Info* loc_USAGI = (Info*)malloc(sizeof(Info)*(1000001));
	Info* loc_NEKO = (Info*)malloc(sizeof(Info)*(1000001));

	for(int i = 1; i <= 1000000; i++){
		loc_USAGI[i].exist = false;
		loc_NEKO[i].exist = false;
	}

	Info** map_USAGI = (Info**)malloc(sizeof(Info*)*n);
	Info** map_NEKO = (Info**)malloc(sizeof(Info*)*n);
	for(int i = 0; i < n; i++){
		map_USAGI[i] = (Info*)malloc(sizeof(Info)*n);
		map_NEKO[i] = (Info*)malloc(sizeof(Info)*n);
	}

	for(int row = 0; row < n; row++){
		for(int col = 0; col < n; col++){
			map_USAGI[row][col].checked = false;
			map_NEKO[row][col].checked = false;
		}
	}

	for(int row = 0; row < n; row++){
		for(int col = 0; col < n; col++){
			scanf("%d",&map_USAGI[row][col].value);
			loc_USAGI[map_USAGI[row][col].value].exist = true;
			loc_USAGI[map_USAGI[row][col].value].row = row;
			loc_USAGI[map_USAGI[row][col].value].col = col;
		}
	}

	for(int row = 0; row < n; row++){
		for(int col = 0; col < n; col++){
			scanf("%d",&map_NEKO[row][col].value);
			loc_NEKO[map_NEKO[row][col].value].exist = true;
			loc_NEKO[map_NEKO[row][col].value].row = row;
			loc_NEKO[map_NEKO[row][col].value].col = col;
		}
	}

	vector<Data> Usagi_D,Neko_D;

	int tmp,usagi_line,neko_line,count,start_row,start_col,tmp_row,tmp_col;
	int usagi_check_num = 0,neko_check_num = 0;

	bool usagi_FLG,neko_FLG;

	for(int loop = 0; loop < m; loop++){
		scanf("%d",&tmp);

		usagi_FLG = false;
		neko_FLG = false;

		if(loc_USAGI[tmp].exist == true){
			usagi_check_num++;
			usagi_FLG = true;
			map_USAGI[loc_USAGI[tmp].row][loc_USAGI[tmp].col].checked = true;

			if(loc_USAGI[tmp].row == 0 || loc_USAGI[tmp].col == 0){
				Usagi_D.push_back(Data(loc_USAGI[tmp].row,loc_USAGI[tmp].col));
			}
		}
		if(loc_NEKO[tmp].exist == true){
			neko_check_num++;
			neko_FLG = true;
			map_NEKO[loc_NEKO[tmp].row][loc_NEKO[tmp].col].checked = true;

			if(loc_NEKO[tmp].row == 0 || loc_NEKO[tmp].col == 0){
				Neko_D.push_back(Data(loc_NEKO[tmp].row,loc_NEKO[tmp].col));
			}
		}

		usagi_line = 0;
		if(usagi_FLG && usagi_check_num >= n){
			for(int i = 0; i < Usagi_D.size(); i++){
				start_row = Usagi_D[i].row;
				start_col = Usagi_D[i].col;

				if(n > 1){

					if(start_row == 0 && start_col == 0){
						for(int k = 0; k < 3; k++){
							tmp_row = start_row;
							tmp_col = start_col;
							count = 0;
							while(rangeCheck(tmp_row,tmp_col) == true && map_USAGI[tmp_row][tmp_col].checked == true){
								count++;
								tmp_row = tmp_row + diff_row_hidariue[k];
								tmp_col = tmp_col + diff_col_hidariue[k];
							}
							if(count >= n){
								usagi_line++;
							}
						}
					}else if(start_row == 0 && start_col == n-1){
						for(int k = 0; k < 2; k++){
							tmp_row = start_row;
							tmp_col = start_col;
							count = 0;
							while(rangeCheck(tmp_row,tmp_col) == true && map_USAGI[tmp_row][tmp_col].checked == true){
								count++;
								tmp_row = tmp_row + diff_row_migiue[k];
								tmp_col = tmp_col + diff_col_migiue[k];
							}
							if(count >= n){
								usagi_line++;
							}
						}
					}else if(start_row == 0){
						tmp_row = start_row;
						tmp_col = start_col;
						count = 0;
						while(rangeCheck(tmp_row,tmp_col) == true && map_USAGI[tmp_row][tmp_col].checked == true){
							count++;
							tmp_row = tmp_row + diff_row_hidariue[1];
							tmp_col = tmp_col + diff_col_hidariue[1];
						}
						if(count >= n){
							usagi_line++;
						}
					}else{ //tmp_col == 0
						tmp_row = start_row;
						tmp_col = start_col;
						count = 0;
						while(rangeCheck(tmp_row,tmp_col) == true && map_USAGI[tmp_row][tmp_col].checked == true){
							count++;
							tmp_row = tmp_row + diff_row_hidariue[0];
							tmp_col = tmp_col + diff_col_hidariue[0];
						}
						if(count >= n){
							usagi_line++;
						}
					}
				}else{
					usagi_line = 1;
				}
			}
		}

		neko_line = 0;
		if(neko_FLG && neko_check_num >= n){
			for(int i = 0; i < Neko_D.size(); i++){
				start_row = Neko_D[i].row;
				start_col = Neko_D[i].col;

				if(n > 1){
					if(start_row == 0 && start_col == 0){
						for(int k = 0; k < 3; k++){
							tmp_row = start_row;
							tmp_col = start_col;
							count = 0;
							while(rangeCheck(tmp_row,tmp_col) == true && map_NEKO[tmp_row][tmp_col].checked == true){
								count++;
								tmp_row = tmp_row + diff_row_hidariue[k];
								tmp_col = tmp_col + diff_col_hidariue[k];
							}
							if(count >= n){
								neko_line++;
							}
						}
					}else if(start_row == 0 && start_col == n-1){
						for(int k = 0; k < 2; k++){
							tmp_row = start_row;
							tmp_col = start_col;
							count = 0;
							while(rangeCheck(tmp_row,tmp_col) == true && map_NEKO[tmp_row][tmp_col].checked == true){
								count++;
								tmp_row = tmp_row + diff_row_migiue[k];
								tmp_col = tmp_col + diff_col_migiue[k];
							}
							if(count >= n){
								neko_line++;
							}
						}
					}else if(start_row == 0){
						tmp_row = start_row;
						tmp_col = start_col;
						count = 0;
						while(rangeCheck(tmp_row,tmp_col) == true && map_NEKO[tmp_row][tmp_col].checked == true){
							count++;
							tmp_row = tmp_row + diff_row_hidariue[1];
							tmp_col = tmp_col + diff_col_hidariue[1];
						}
						if(count >= n){
							neko_line++;
						}
					}else{ //tmp_col == 0
						tmp_row = start_row;
						tmp_col = start_col;
						count = 0;
						while(rangeCheck(tmp_row,tmp_col) == true && map_NEKO[tmp_row][tmp_col].checked == true){
							count++;
							tmp_row = tmp_row + diff_row_hidariue[0];
							tmp_col = tmp_col + diff_col_hidariue[0];
						}
						if(count >= n){
							neko_line++;
						}
					}
				}else{
					neko_line = 1;
				}
			}
		}


		if(usagi_line >= u && neko_line >= v){
			printf("DRAW\n");
			return 0;
		}else if(usagi_line >= u && neko_line < v){
			printf("USAGI\n");
			return 0;
		}else if(usagi_line < u && neko_line >= v){
			printf("NEKO\n");
			return 0;
		}
	}

	printf("DRAW\n");

	return 0;
}

Measured memory_bytes: 38296