Program Pr;
Var
a : array [1..100, 1..100] of integer;
i, max, min, j, n: integer;
Begin
cls;
read(n);
min := 100000;
max := -100000;
for i := 1 to n do
for j := 1 to n do
begin
read(a[i,j]);
if (a[i,j] > max) then
max := a[i,j];
if (a[i,j] < min) then
min := a[i,j];
end;
writeln ('Сумма = ', min + max);
writeln ('Разность = ', max - min);
writeln ('Произведение = ', max * min);
End.