{"problem":{"name":"G. 007: You Only Live Thrice","description":{"content":"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 conv","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10253G"},"statements":[{"statement_type":"Markdown","content":"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.\n\nWhat 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.\n\nSince 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.\n\nThe 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.\n\nThe first line of input contains a single integer $t$, the number of test cases. \n\nEach test case consists of a single line containing a single integer, $m$. \n\n*Constraints*\n\n$1 <= t <= 10^5$\n\n$1 <= m <= 10^(18)$ \n\nFor 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: _—_\n\n## Input\n\nThe 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 <= t <= 10^5$$1 <= m <= 10^(18)$ \n\n## Output\n\nFor 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: _—_\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ t \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, t\\} $:  \n- Let $ a_k \\in \\mathbb{Z} $ be the total number of available actors.  \n- Let $ g_k \\in \\mathbb{Z} $ be the number of cast slots per movie.  \n- Let $ n_k \\in \\mathbb{Z} $ be the total number of movie episodes.  \n- Let $ C_{k,1} = (c_{k,1,1}, c_{k,1,2}, \\dots, c_{k,1,g_k}) $ be the initial cast list for episode 1, where $ c_{k,1,i} \\in \\{ \\text{actor names} \\} $.  \n- Let $ A_k = \\{ \\alpha_1, \\alpha_2, \\dots, \\alpha_{a_k} \\} $ be the set of all available actors.  \n\n**Constraints**  \n1. $ 1 \\le t \\le 100 $  \n2. For each $ k \\in \\{1, \\dots, t\\} $:  \n   - $ 1 \\le g_k \\le a_k \\le 100 $  \n   - $ 2 \\le n_k \\le 100 $  \n   - Each actor in $ C_{k,1} $ is in $ A_k $  \n\n**Objective**  \nFor each test case $ k $, produce a sequence of $ n_k - 1 $ cast transitions $ T_k = (T_{k,2}, T_{k,3}, \\dots, T_{k,n_k}) $, where each transition $ T_{k,j} = (a_{\\text{out}}, a_{\\text{in}}) $ satisfies:  \n- $ a_{\\text{out}} \\in C_{k,j-1} $ (an actor currently in the cast)  \n- $ a_{\\text{in}} \\in A_k \\setminus C_{k,j-1} $ (an actor not currently in the cast)  \n- $ C_{k,j} $ is obtained by replacing $ a_{\\text{out}} $ with $ a_{\\text{in}} $ in $ C_{k,j-1} $  \n\nOutput $ n_k - 1 $ such transitions, one per line, for each test case.  \nOutput a blank line before each test case’s output except the first.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10253G","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}