program FindMinBetween3Numbers;
uses math;
var num1, num2, num3, ans : int64;
w : string;
begin
ans := 0;
writeln('enter first number');
readln(num1);
writeln('enter second number');
readln(num2);
writeln('enter three number');
readln(num3);
writeln('write "min" if you wanna find minimum and write "max" if you wanna find maximum');
readln(w);
if w = 'min' then
begin
ans:= min(min(num1, num2), num3);
writeln('the minimum between', ' ', num1, ', ', num2, ' and ', num3, ' is ', ans );
end;
if w = 'max' then
begin
ans:= max(max(num1, num2), num3);
writeln('the maximum between', ' ', num1, ', ', num2, ' and ', num3, ' is ', ans );
end;
end.