406750: GYM102535 G 007: You Only Live Thrice

Memory Limit:256 MB Time Limit:3 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. 007: You Only Live Thricetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Dr. Evil is up to his evil antics again and has traveled back in time to 1975 to enact his evil schemes. The British Intelligence Agency needs someone to travel back in time as well to thwart his convoluted plot. Seeing the opportunity to be part of an adventure that involves riveting mysteries, amorous escapades, and gratuitous violence, you volunteer for the role of 007.

What the British Intelligence Agency failed to tell you was that in this iteration, not only will you be agent 007. You will also be 007 years old and do 007-year-old things. As part of your role, you will receive encrypted messages with a secret marker and you have to decode whether it's meant for Agent 003, Agent 005, or Agent 007 (you). The marker will be divisible by 3 if it's meant for Agent 003, divisible by 5 if it's meant for Agent 005, and 7 if it's meant for Agent 007.

Since you retained your mental maturity, you want to avoid doing tedious tasks equivalent to homework for 007-year-olds. You want to leave it to a computer to do the job.

The program you write must accept a number $$$m$$$ (the secret marker) and output AGENT 003 if it's divisible by 3, AGENT 005 if it's divisible by 5, and AGENT 007 if it's divisible by 7.

Input

The first line of input contains a single integer $$$t$$$, the number of test cases.

Each test case consists of a single line containing a single integer, $$$m$$$.

Constraints

$$$1 \le t \le 10^5$$$

$$$1 \le m \le 10^{18}$$$

Output

For each test case, output several lines. For each agent the message is meant for—AGENT 003, AGENT 005, and/or AGENT 007—output the agent's name in a single line. If the message is meant for none of you, output NONE. If the message is meant for more than one of you, output each agent in the following order: AGENT 003, AGENT 005, and/or AGENT 007. At the end of the output for each test case, output a single line containing three dashes:

ExampleInput
7
42
420
111
1111
2020
489
123456789012345678
Output
AGENT 003
AGENT 007
---
AGENT 003
AGENT 005
AGENT 007
---
AGENT 003
---
NONE
---
AGENT 005
---
AGENT 003
---
AGENT 003
---

加入题单

上一题 下一题 算法标签: