72
909 34
420 51
621 76
65 48
82 41
665 53
43 33
309 21
942 51
156 13
997 11
753 26
529 41
187 15
961 71
619 7
425 73
126 75
551 77
121 79
349 82
16 12
711 36
676 81
72 2
747 89
265 30
896 13
14 1
289 71
270 17
470 9
33 18
141 33
904 83
915 96
803 38
673 61
621 53
225 14
581 81
65 22
311 3
526 1
525 41
175 39
399 71
166 88
941 39
636 1
514 51
10 1
649 81
993 79
985 81
761 41
246 69
89 71
96 50
49 33
245 1
131 17
811 46
209 1
700 51
697 12
545 81
715 25
788 97
553 19
199 46
195 11
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Nandu
Rani
Rani
Nandu
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Nandu
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Nandu
Rani
Rani
Rani
Rani
Rani
Nandu
Rani
Rani
Nandu
Rani
Rani
Rani
Rani
Rani
Rani
Rani
Rani

t=input()
for _ in range(t):
    n,m=map(int,raw_input().split(' '))
    if(n-1)%(m+1)==0:
		print "Nandu"
    else:
		print"Rani"