406765: GYM102536 D Move to Remove Confidential Blunders

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

Description

D. Move to Remove Confidential Blunderstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

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

  • $$$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

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.
ExamplesInput
18 R-18
Frozen 3
Output
OK
Input
1 R-13
Star Wars: The Fall of Skywalker
Output
ACCESS DENIED
Input
13 PG
Agent Cody Banks
Output
OK
Input
1000 G
Die Hard: Finally Die
Output
OK
Input
15 R-16
Blaze Runner: 2049
Output
ACCESS DENIED
Input
9 PG
Hunger Games: Catching Firaga
Output
OK IF ACCOMPANIED
Input
10000 R-18
Karate Adult
Output
OK
Input
123456 G
Min Payne
Output
OK
Input
1 G
Mark of the Mini-Ninjas
Output
OK
Input
420 R-13
Team Fortress 5
Output
OK
Input
17 R-18
Heneral Looney
Output
ACCESS DENIED

加入题单

上一题 下一题 算法标签: