Problem G
Miðjan
Languages
en
is
As a preschool teacher you are used to children being absent due to sickness. A part of your job is taking attendance, so you are in the possession of this week’s attendance. Today is Wednesday, so you have the full attendance for Monday and Tuesday. You have on your list who showed up to school on Monday and who showed up on Tuesday, but you are interested in finding out who showed up only on Monday, or only on Tuesday.
Specifically, for each day in turn, you want to find out which children attended only on that day. To adhere to local privacy laws no names appear on the list of attendance. The children are instead represented by numbers.
Input
The first line of the input contains two integers $n$ and $m$ ($1 \leq n, m \leq 100$). The second line of the input contains $n$ distinct integers $x$ ($1 \leq x \leq 10^5$). The third line of the input contains $m$ distinct integers $x$ ($1 \leq x \leq 10^5$). The second line describes the students that attended on Monday, and the third line describes thee students that attended on Tuesday.
Output
The first line of the output should include those number in the second line that do not appear in the third line, and should be printed in the order they appear in the input. The second line of the output should include those number in the third line that do not appear in the second line, and should be printed in the order they appear in the input.
Sample Input 1 | Sample Output 1 |
---|---|
3 3 1 2 3 1 2 4 |
3 4 |
Sample Input 2 | Sample Output 2 |
---|---|
3 2 1 6 2 2 4 |
1 6 4 |
Sample Input 3 | Sample Output 3 |
---|---|
8 7 1 4 3 2 5 8 7 6 9 1 7 8 3 2 4 |
5 6 9 |