#C4093. Critical Alerts Identification

    ID: 47593 Type: Default 1000ms 256MiB

Critical Alerts Identification

Critical Alerts Identification

You are given a list of event logs from a monitoring system. Each event log consists of three components: a sender ID, a priority level, and a message. An alert is considered critical if any of the following conditions is met:

  1. The message contains the word (\texttt{critical}) (case-insensitive).
  2. The priority is (\texttt{critical}) (case-insensitive).
  3. The priority is (\texttt{warning}) (case-insensitive) and the sender ID is 1.

Your task is to identify and output all critical alerts in the order they appear in the input. For each critical alert, print the result in the format: : .

inputFormat

The first line contains an integer (n) representing the number of event logs. Each of the following (n) lines contains an event log entry with three parts separated by spaces:

  • The sender ID (an integer).
  • The priority (a single word).
  • The message (a string that may contain spaces, occupying the rest of the line).

Read input from standard input (stdin).

outputFormat

Output each critical alert on a separate line in the order they appear. Each line must follow the format: : . Print the results to standard output (stdout). If there are no critical alerts, output nothing.## sample

3
101 Normal All systems operational
202 Normal Memory usage stable
303 Normal Temperature within acceptable ranges