#t87. 大家都来找不同
大家都来找不同
Finding the Differences
Problem Description
Dazhi encountered a problem in a book he bought:
Given two non-negative integer arrays and , remove the numbers that appear in both and , and output the numbers unique to each array. Output the remaining numbers of first (in their original input order), then those of (in their original input order).
He now wants to challenge you. Can you solve it?
Input Format
There are three lines in total. The first line contains two integers , the numbers of elements in arrays and ().
The second line contains non-negative integers, the array . A number may appear multiple times. Each number does not exceed .
The third line contains non-negative integers, the array . A number may appear multiple times. Each number does not exceed .
The input guarantees that and always have some different numbers.
Output Format
One line: first output the remaining numbers of array , then the remaining numbers of array .
Sample Input
4 4
1 5 4 1
2 8 1 6
Sample Output
5 4 2 8 6