406765: GYM102536 D Move to Remove Confidential Blunders
Description
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:
- "G" - no need for age-verification
- "PG" - anyone below 13 years old should be accompanied by a responsible adult
- "R-13" - none below 13 years old
- "R-16" - none below 16 years old
- "R-18" - none below 18 years old
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.
InputThere 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
- $$$0 \leq a\leq 10^9$$$
- The title length, $$$\ell$$$, satisfies $$$1\leq \ell \leq 100$$$.
- The ranking string is one of G, PG, R-13, R-16, R-18.
- The title consists of characters whose ASCII values are between 32 and 126.
Output a single line containing (without the quotes):
- "OK" if you can give the person access,
- "OK IF ACCOMPANIED" if you can give the person access if accompanied by a responsible adult, or
- "ACCESS DENIED" otherwise.
18 R-18 Frozen 3Output
OKInput
1 R-13 Star Wars: The Fall of SkywalkerOutput
ACCESS DENIEDInput
13 PG Agent Cody BanksOutput
OKInput
1000 G Die Hard: Finally DieOutput
OKInput
15 R-16 Blaze Runner: 2049Output
ACCESS DENIEDInput
9 PG Hunger Games: Catching FiragaOutput
OK IF ACCOMPANIEDInput
10000 R-18 Karate AdultOutput
OKInput
123456 G Min PayneOutput
OKInput
1 G Mark of the Mini-NinjasOutput
OKInput
420 R-13 Team Fortress 5Output
OKInput
17 R-18 Heneral LooneyOutput
ACCESS DENIED