#C4636. Event Reminder Notifications

    ID: 48196 Type: Default 1000ms 256MiB

Event Reminder Notifications

Event Reminder Notifications

You are given a sequence of events. Each event includes a list of guest identifiers (integers). For each event starting from the second one, determine which guests should receive a reminder. A guest should receive a reminder for the current event if they did not attend the immediately previous event.

In other words, if an event has a guest who never appeared in the prior event, then that guest should be added to the reminder list. The output should preserve the order of guest IDs as they appeared in the current event.

Note: The input is read from standard input (stdin) and the result should be printed to standard output (stdout).

Mathematically, for each event Ei for i \ge 2, you need to compute:

[ R_i = { x \in E_i \mid x \notin E_{i-1} } ]

inputFormat

The input is given via standard input in the following format:

  1. An integer n representing the number of events.
  2. For each event, a line starting with an integer m (the number of guest IDs in that event), followed by m space-separated integers representing the guest IDs.

For example:

4
3 1 2 3
3 2 3 4
2 1 2
2 2 5

outputFormat

For each event from the second event to the last event, output a single line containing the guest IDs (space-separated) that should receive a reminder. If no guest qualifies for a reminder for an event, output an empty line.

## sample
4
3 1 2 3
3 2 3 4
2 1 2
2 2 5
4

1 5

</p>