number = int(input())
score = list(map(int,input().split()))
deny = 0
for i in range(number):
    if score[i] % 2 == 0:
        if score[i] % 3 != 0 and score[i] % 5 != 0:
            deny = 1
            break
if deny == 1:
    print('DENIED')
else:
    print('APPROVED') number = int(input()) number int(input()) int input() input score = list(map(int,input().split())) score list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split deny = 0 deny 0 for i in range(number):
    if score[i] % 2 == 0:
        if score[i] % 3 != 0 and score[i] % 5 != 0:
            deny = 1
            break i range(number) range number if score[i] % 2 == 0:
        if score[i] % 3 != 0 and score[i] % 5 != 0:
            deny = 1
            break score[i] % 2 == 0 score[i] % 2 score[i] score i 2 0 if score[i] % 3 != 0 and score[i] % 5 != 0:
            deny = 1
            break score[i] % 3 != 0 and score[i] % 5 != 0 score[i] % 3 != 0 score[i] % 3 score[i] score i 3 0 score[i] % 5 != 0 score[i] % 5 score[i] score i 5 0 deny = 1 deny 1 break if deny == 1:
    print('DENIED')
else:
    print('APPROVED') deny == 1 deny 1 print('DENIED') print 'DENIED' print('APPROVED') print 'APPROVED' number = int(input()) int(input()) number deny = 0 0 deny score = list(map(int,input().split())) list(map(int,input().split())) score deny = 1 1 deny
number = int(input())
score = list(map(int,input().split()))
deny = 0
for i in range(number):
    if score[i] % 2 == 0:
        if score[i] % 3 != 0 and score[i] % 5 != 0:
            deny = 1
            break
if deny == 1:
    print('DENIED')
else:
    print('APPROVED')