Under construction

Still being built. Things may change

Yes or No Vote

Time limit2sMemory limit512 MB

Summary
Given N votes coded as 1, -1, or 0, decide whether the vote is APPROVED, REJECTED, or INVALID when abstentions are at least half.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

A yes-or-no vote was held among the students enrolled at Chung-Ang University. Every enrolled student answered the vote with yes, no, or abstain.

The vote passes if the number of yes votes is greater than the number of no votes. If the number of no votes is greater than or equal to the number of yes votes, the vote does not pass. However, if abstentions are at least half of all enrolled students, the vote is invalid regardless of the yes and no counts.

Write a program that reads the votes and prints the result of the vote.

Input

The first line contains the number of enrolled students NN.

The second line contains NN votes separated by spaces. A yes vote is given as 1, a no vote as -1, and an abstention as 0.

Output

Print APPROVED if the vote passed, REJECTED if it did not pass, and INVALID if the vote was invalidated.

Constraints

  • 1≤N≤1001 \le N \le 100

Examples4

  1. Example 1

    Input
    5
    1 -1 1 1 -1
    
    Expected output
    APPROVED
    
  2. Example 2

    Input
    3
    -1 1 -1
    
    Expected output
    REJECTED
    
  3. Example 3

    Input
    4
    1 0 -1 1
    
    Expected output
    APPROVED
    
  4. Example 4

    Input
    4
    1 0 0 1
    
    Expected output
    INVALID