Module Module1

    Sub Main()
        Dim readline As String
        Dim hogelen As Integer = 0
        Dim hogehoge() As String

        hogelen = CType(Console.ReadLine(), Integer)
        readline = Console.ReadLine()

        hogehoge = readline.Split(" ")

        Dim wasawasa(hogelen) As Integer

        Dim i As Integer = 0
        For Each tempstr As String In hogehoge
            wasawasa(i) = CType(tempstr, Integer)
            i += 1
        Next

        If nyukokucheck(wasawasa) Then
            Console.Write("APPROVED")
        Else
            Console.Write("DENIED")
        End If



    End Sub


    Private Function nyukokucheck(ByVal hogehoge As Integer()) As Boolean

        For Each value As Integer In hogehoge
            If value Mod 2 = 0 Then
                If value Mod 3 = 0 Then
                    Continue For
                ElseIf value Mod 5 = 0 Then
                    Continue For
                Else
                    Return False
                End If
            End If
        Next
        Return True
    End Function

End Module
