Memory training#184

Memory training

1 second
256 megabytes
Easy

Vasyl and Petro are training their memories. To do this, they take an array with elements and perform the following actions:

Obviously, after moves, all elements of the array will be distributed between Vasyl and Petro.

Let's take a look at an example of how memory training works. Let the initial array be A = [1\; 2\; 3\; 4\; 5\; 6].

Write a program that, given an input array and the sequence of actions, determines who got which elements.

Input

The first line contains a single integer (2 \leq n \leq 1\,000) — the number of elements in the array.

The second line contains integers a_1, a_2, \dots, a_n (-10^9 \leq a_i \leq 10^9).

Each of the following (n-1) lines contains an array, which was named by either Vasyl or Petro. It is guaranteed that the arrays are correct, that is, each of them can be obtained from the previous one.

Output

In the first line, output the elements that Vasyl took in non-descending order.

In the second line, output the elements that Petro took in non-descending order.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Scoring

In this problem, each test is evaluated separately. However, further:

  1. In 22% of the tests, each integer from to occurs exactly once in the initial array .

  2. In 35% of the tests, n \leq 10.