#K61292. Discrepancy Tracker

    ID: 31277 Type: Default 1000ms 256MiB

Discrepancy Tracker

Discrepancy Tracker

Given three lists of integer counts recorded over three consecutive days, determine the missing item from each subsequent day. The first list (Day 1) has one extra element compared to Day 2, and Day 2 has one extra element compared to Day 3.

Your task is to find:

  • The element present in Day 1 but missing in Day 2.
  • The element present in Day 2 but missing in Day 3.

Formally, if the lists are denoted as \(A\), \(B\), and \(C\), then you need to find:

[ \text{discrepancy}_1 = A \setminus B,\quad \text{discrepancy}_2 = B \setminus C ]

It is guaranteed that each difference will result in exactly one missing number.

inputFormat

The input is given via standard input (stdin) in the following format:

<n1>
<list of n1 integers separated by spaces>
<n2>
<list of n2 integers separated by spaces>
<n3>
<list of n3 integers separated by spaces>

Here, n1, n2, and n3 denote the number of elements in the Day 1, Day 2, and Day 3 lists respectively. Note that \(n1 = n2 + 1\) and \(n2 = n3 + 1\).

outputFormat

Print two integers separated by a space. The first integer is the missing element from Day 1 to Day 2, and the second integer is the missing element from Day 2 to Day 3.

Output is produced via standard output (stdout).

## sample
4
11 5 7 3
3
5 7 3
2
7 3
11 5