Module B
    Sub Main(ByVal args() As String)
        Dim n As Integer = Integer.Parse(Console.ReadLine())
        Dim arr() As String = Split(Console.ReadLine())
        Dim i, wk As Integer
        For i = 0 To n - 1
            wk = arr(i)
            If (wk Mod 2 = 0) AndAlso (wk Mod 3 <> 0) AndAlso (wk Mod 5 <> 0) Then
                Console.WriteLine("DENIED")
                Return
            End If
        Next
        Console.WriteLine("APPROVED")
    End Sub
End Module