Олимпиадный тренинг

Задача 37690. closeness of thoughts


Задача

Темы: Множества

Deniska and Mishka write down their sets of numbers. Moreover, each boy has different numbers. Then the guys determine how closely their thoughts converge, that is, how many numbers are present in both sets, and how many are different in each set. 

Input
The first line of the input file contains the numbers N and M — the number of numbers for Deniska and Mishka, respectively. The following N lines contain Deniska numbers. In the last M lines - Mishka's numbers.

Imprint 
Print first the quantity, and then the numbers sorted in ascending order, those that are in both sets, then the quantity and the remaining numbers sorted in ascending order from Deniska's set, then the quantity and numbers sorted in ascending order from Mishka's set.
 
Examples
# Input Output
1 4 3
0
1
10
9
1
3
0
2
0 1
2
9 10
1
3