main = do
  str <- getLine
  let n = read str ::Int
  str <- getLine
  let a = take n $ map read (words str) ::[Int]
  let ret = and $ map ck $ filter even a
  if ret == True
    then putStrLn "APPROVED"
    else putStrLn "DENIED"


ck :: Int -> Bool
ck n
  | n `mod` 3 == 0 = True
  | n `mod` 5 == 0 = True
  | otherwise      = False