program patuljci;
var a,b,c,d,f,g,h:integer;
arr:array[1..10000] of integer; st1:string;
arrst:array[1..10000] of string;
begin
readln(a,b);
for c:=1 to a do read(arr[c]);
readln(d);
for b:=1 to d do begin
readln(f,g);
if arr[f]=arr[g] then begin
str(arr[f],st1);  arrst[b]:='da '+st1; end
else arrst[b]:='ne';
end;
for b:=1 to d do writeln(arrst[b]);
end.