Kristen is a meteorologist, who is monitoring extreme temperatures in the forest of Palaiseau. She has collected temperature measurements at various times over several days. Help her find out what the lowest and highest temperatures were in her entire dataset.
The input is formed of n (1 ≤ n ≤ 1000) lines, each line i (1 ≤ i ≤ n) being a space-separated list of k[i]
(2 ≤ k[i]
≤ 100) tokens:
the first token is the date of the measurement, in the form YYYY-MM-DD;
for j (2 ≤ j ≤ k[i]
), the j-th entry is an integer temperature measurement t[ij]
(-50 ≤ t[ij]
≤ 50).
The output should contain a single line with two integers: the lowest and highest temperatures in the entire dataset, in this order.