var a, b, c, d, min, max: integer;
begin
// Min
readln(a, b, c, d);
if (a <= b) and (a <= c) and (a <= d) then min := a
else if (b <= a) and (b <= c) and (b <= d) then min := b
else if (c <= a) and (c <= b) and (c <= d) then min := c
else if (d <= a) and (d <= b) and (d <= c) then min := d;
// Max
if (a >= b) and (a >= c) and (a >= d) then max := a
else if (b >= a) and (b >= c) and (b >= d) then max := b
else if (c >= a) and (c >= b) and (c >= d) then max := c
else if (d >= a) and (d >= b) and (d >= c) then max := d;
writeln('Min: ', min);
writeln('Max: ', max);
end.
var a, b, c, d, min, max: integer;
begin
// Min
readln(a, b, c, d);
if (a <= b) and (a <= c) and (a <= d) then min := a
else if (b <= a) and (b <= c) and (b <= d) then min := b
else if (c <= a) and (c <= b) and (c <= d) then min := c
else if (d <= a) and (d <= b) and (d <= c) then min := d;
// Max
if (a >= b) and (a >= c) and (a >= d) then max := a
else if (b >= a) and (b >= c) and (b >= d) then max := b
else if (c >= a) and (c >= b) and (c >= d) then max := c
else if (d >= a) and (d >= b) and (d >= c) then max := d;
writeln('Min: ', min);
writeln('Max: ', max);
end.
{
if (tnum < tden)
{
temp = tnum;
tnum = tden;
tden = temp;
}
tnum = tnum - tden;
}
gcd = tden; //вычисляем наибольший общий делитель
numerator = numerator / gcd; //делим числитель и знаменатель на
НОД, получаем сокращенную дробь
denominator = denominator / gcd;