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

Задача 28333. Stylish clothes


Задача

Темы: "Два указателя"
Gleb loves shopping. Once he got the idea to choose a cap, T-shirt, pants and boots so as to look as stylish as possible in them. In Gleb's understanding, the style of clothes is the greater, the smaller the difference in the color of the elements of his clothes.
 
There are N1 caps, N2 T-shirts, N3 pants and N4 pairs of boots (1 ≤ Ni ≤ 100 000). For each item of clothing, its color is known (an integer from 1 to 100 000). Clothing set — it is one cap, jersey, pants and one pair of boots. Each set is characterized by the maximum difference between any two of its elements. Help Gleb choose the most stylish set, that is, the set with the minimum color difference.
 
Input
For each type of clothing i (i = 1, 2, 3, 4), first enter the number Ni of clothing items of this type, then in the next line — a sequence of Ni integers describing the colors of the elements. All four types are entered sequentially, starting with caps and ending with boots. All entered numbers are integers, positive and do not exceed 100 000.
 
Output
Print four integers — colors respectively for the cap, T-shirt, pants and boots, which Gleb must choose from those available in order to look the most stylish. If there are several answers, print any one.
 
Input Output
3
1 2 3
2
1 3
2
3 4
2
2 3
3 3 3 3
1
5
4
3 6 7 10
4
18 3 9 11
1
20
5 6 9 20