Problem:
Score: 200 points

Problem Statement

You are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.

According to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:

All even numbers written on the document are divisible by 3 or 5.

If the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.

Notes

The condition in the statement can be rephrased as "If x is an even number written on the document, x is divisible by 3 or 5".
Here "if" and "or" are logical terms.

Constraints

All values in input are integers.

1 \leq N \leq 100

1 \leq A_i \leq 1000

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 \dots A_N

Output

If the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.

Sample Input 1

5
6 7 9 10 31

Sample Output 1

APPROVED

The even numbers written on the document are 6 and 10.

All of them are divisible by 3 or 5, so the immigrant should be allowed entry.

Sample Input 2

3
28 27 24

Sample Output 2

DENIED

28 violates the condition, so the immigrant should not be allowed entry.

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

        #include <bits/stdc++.h>
        using namespace std;
        typedef long long ll;
        typedef long double ld;
        typedef pair<ll, ll> l_l;
        typedef pair<int , int> i_i;
        typedef vector<ll> vl;
        typedef vector<int> vi;
        typedef vector<char> vec;
        typedef vector<bool> veb;
        typedef vector<string> ves;
        typedef vector<vector<ll>> vvl;
        typedef vector<vector<int>> vvi;
        typedef vector<vector<char>> vvec;
        typedef vector<vector<bool>> vveb;
        typedef vector<vector<string>> vves;
        #define rep(i,n) for(int i=0;i<(int)(n);i++)
        #define rep1(i,n) for(int i=1;i<(int)(n);i++)
        #define rep2(i,n) for(int i=2;i<(int)(n);i++)
        #define repk(i,k,n) for(int i=k;i<(int)(n);i++)
        #define fs first
        #define sc second
        #define pb push_back
        #define pp pop_back
        #define all(a) a.begin(),a.end()
        #define rall(a) a.rbegin(),a.rend()
        #define maxel(a) *max_element(all(a))
        #define minel(a) *min_element(all(a))
        #define acc accumulate
        #define EPS (1e-7)
        #define INF (1e9)
        #define PI (acos(-1))
        #define mod (1000000007)
        typedef long long int64;
        //const int64 INF = 1LL << 58;
        #define dame { puts("-1"); return 0;}
        #define YES { cout << "YES" << endl; return 0; }
        #define NO { cout << "NO" << endl; return 0; }
        #define Yes { cout << "Yes" << endl; return 0; }
        #define No { cout << "No" << endl; return 0; }
        template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
        template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
        int dx[] = {0, 0, -1, 1};
        int dy[] = {1, -1, 0, 0};
         
        int main(){
        	cin.tie(0);
        	ios::sync_with_stdio(false);
         
          	int n;
          	cin >> n;
          	vi a(n);
      
          	rep(i,n){cin >> a.at(i);}
          	rep(i,n){
                    if(a.at(i)%2 == 0){
                    	if(a.at(i)%3 != 0 && a.at(i)%5 != 0){cout << "DENIED" << endl;return 0;} 
                    }      
            }
          cout << "APRROVED" << endl;
          return 0;  
        }