| 2020 UP ACM Algolympics Final Round |
|---|
| Finished |
The past year has not been very great for you and your team. So many embarassing mistakes have been made. And very public ones at that. With the advent of the Weirdly Wide Web, everyone now knows what you're doing. Clips of your team have been uploaded to the "Cloud" and anyone can watch it via UTube.
For instance, there was that one time when you tried to track an IP address using the GUI interface that you created with Visual Advanced.
Or that time when a hacker broke past your team's firewall, swiftly causing sparks to fly and creating actual fire in your department.
That time when you tried to launch a cybernuke.
Or asked the CCTV guy to rotate the picture 75 degrees around the vertical.
Of course, nothing beats the time when a computer virus took over during Freedom Day. As any beginning progammer can tell you, binary code is a series of ones and zeroes. The virus turned ones into zeroes and zeroes into ones, effectively reversing your code.
The list goes on. Downcast at this very long list of blunders, you wonder how you and your team will move forward. Fortunately, your VP, also known as Vision Possible, steps in and tells you of a plan to turn the situation around.
He calls it the "Move to Remove Confidential Blunders (MTRCB)". Explaining further, he says that the past mistakes were due to unsupervised access to usually confidential documents, movies, and other secrets. The key, therefore, is to implement a chain of command according to each person's capability, which is of course measured by age. Obviously, age determines everything about a person. It is a hierarchical world we live in, after all.
While you stand amazed at Vision Possible's ability to do the impossible, the MTRCB's rules are explained to you. Since generally, people are already responsible when they turn 18 years old, you now have these rankings:
Now, you must do your part in implementing these rules. You do your best as your team's success depends on this. Given a person's age, the corresponding ranking, and the title of what that person wants to access, say if you should grant access to that person.
There is only one test case per file. The test case is formatted in two lines.
The first line contains an integer $$$a$$$ denoting the age of the person that you are checking access for, followed by a space, and then followed by a string denoting the corresponding ranking of what that person wants to access.
The next line contains the title of what the person wants to access.
Constraints
Output a single line containing (without the quotes):
18 R-18 Frozen 3
OK
1 R-13 Star Wars: The Fall of Skywalker
ACCESS DENIED
13 PG Agent Cody Banks
OK
1000 G Die Hard: Finally Die
OK
15 R-16 Blaze Runner: 2049
ACCESS DENIED
9 PG Hunger Games: Catching Firaga
OK IF ACCOMPANIED
10000 R-18 Karate Adult
OK
123456 G Min Payne
OK
1 G Mark of the Mini-Ninjas
OK
420 R-13 Team Fortress 5
OK
17 R-18 Heneral Looney
ACCESS DENIED
| Name |
|---|


