#K3346. Invalid Access Times

    ID: 25092 Type: Default 1000ms 256MiB

Invalid Access Times

Invalid Access Times

You are given a time interval representing the allowed access hours and a list of keycard usage log entries. Each log entry has a time stamp and an action (either "enter" or "exit"). Your task is to determine which log entries occur outside the allowed time range. An entry is valid if its time (t) satisfies (\text{start_time} \le t \le \text{end_time}); otherwise, it is invalid. If every log entry falls within the allowed hours, output "ALL ACCESS TIMES VALID".

inputFormat

The input is provided via standard input (stdin). The first line contains two strings in the HH:MM format separated by a space, representing the allowed start and end times. The second line contains an integer (n), which denotes the number of log entries. Each of the following (n) lines contains a log entry in the format "time action".

outputFormat

Output the log entries that are outside the allowed time interval, each on a new line, in the order they appear. If all entries are within the allowed period, output "ALL ACCESS TIMES VALID".## sample

09:00 17:00
3
09:00 enter
12:00 exit
17:00 exit
ALL ACCESS TIMES VALID