Compute Chokepoint


Submit solution


Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Python

You are the only tech guy at a government contractor working a 996 (9 am to 9 pm, 6 days a week), and you have just been asked to set up a service to send network messages. However, the network switch is from 1991 and there is no budget for a new one. There is a handwritten note next to the switch that says it will catch fire if more than 5 network requests are sent in 10 seconds.

Thus, you must make a network gateway that will only forward messages if they wouldn't cause the switch to catch fire. If the request would cause the number to go over the limit, too bad for them... they can figure out how to resend it or hotspot from their phones or something.

Input

The first line contains an integer n\ (1 \leq n \leq 10^5), the number of network messages you will receive.

The next n lines each contain an integer x_i\ (1 \leq x_i \leq 10^6), the time that the ith message is sent. These will be given in non-decreasing order.

Output

For each of the inputted messages, you should decide whether to accept or deny the message in order to fulfill the requirement of sending no more than 5 messages every 10 seconds.

You should output n lines and, if a message would cause more than 5 messages in 10 seconds to be sent, print "DENIED". Otherwise, print "ACCEPTED".

Examples

Input 1
8
1
3
4
7
8
10
12
13
Output 1
ACCEPTED
ACCEPTED
ACCEPTED
ACCEPTED
ACCEPTED
DENIED
ACCEPTED
DENIED

When we get to the message sent at time t=10, there have already been 5 messages sent in the first 10 seconds so we must deny it. However, by the time we get to t=12, the message sent at t=1 was more than 10 seconds ago, so we can accept this message. Due to this, the next message at t=13 cannot be accepted as there have now been 5 messages sent since t=3.

Input 2
6
1
2
3
4
5
12
Output 2
ACCEPTED
ACCEPTED
ACCEPTED
ACCEPTED
ACCEPTED
ACCEPTED

By the time t=12 comes along, t=1 was more than 10 seconds ago, so we are fine to accept all these messages.


Comments

There are no comments at the moment.