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

Задача 38321. Placement of laptops


The school decided to put two rectangular laptops on one rectangular table. Laptops should be placed so that their sides are parallel to the sides of the table. Determine what dimensions the table should have so that both laptops fit on it and the table area is minimal.

Input
Four natural numbers are entered, the first two specify the dimensions of one laptop, and the next two — the dimensions of the second. Numbers do not exceed 1000.

Imprint
Print two numbers — table dimensions. If multiple answers are possible, print any of them (but only one).

Note
The examples show all kinds of answers to the given problem. Your program should output one of them.
Examples
# Input Output
1 10 2 2 10 20 2
2 20
4 10
104
2 5 7 3 2 9 5
5 9