n = input()

l = list( map(int, input().split()))

odd = [ c for c in l if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 ))]
if len( odd ) == 0: 
  print( "APPROVED" )
else:
  print( "DENIED" ) n = input() n input() input l = list( map(int, input().split())) l list( map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split c for c in l if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 )) for c in l if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 )) c l (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 )) c % 2 == 0 c % 2 c 2 0 ( c % 3 != 0) and ( c % 5 !=0 ) c % 3 != 0 c % 3 c 3 0 c % 5 !=0 c % 5 c 5 0 if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 )) c odd = [ c for c in l if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 ))] odd [ c for c in l if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 ))] if len( odd ) == 0: 
  print( "APPROVED" )
else:
  print( "DENIED" ) len( odd ) == 0 len( odd ) len odd 0 print( "APPROVED" ) print "APPROVED" print( "DENIED" ) print "DENIED" l = list( map(int, input().split())) list( map(int, input().split())) l n = input() input() n odd = [ c for c in l if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 ))] [ c for c in l if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 ))] odd
n = input()

l = list( map(int, input().split()))

odd = [ c for c in l if (c % 2 == 0 ) and (( c % 3 != 0) and ( c % 5 !=0 ))]
if len( odd ) == 0: 
  print( "APPROVED" )
else:
  print( "DENIED" )