program P;
uses crt;
var b:array [1..3,1..4] of integer;
    n:integer;
    m:integer;
    t:integer;
    min:integer;
    max:integer;
    k:integer;
    i:integer;
    buf:integer;
 begin
 t:=3;
 Clrscr;
 writeln ('�������� 2-� ���� ���ᨢ');
 for n:=1 to 3 do
 for m:=1 to 4 do
 begin
 write ('B(',n,',',m,')=');
 read (B[n,m]);
 end;
 write ('��������� ���ᨢ:');
 for n:=1 to 3 do
 begin
 writeln;
 for m:=1 to 4 do
 write (B[n,m]:t);
 end;
max:=B[n,m];
t:=1;
for i:=1 to 5 do
if B[n,m]>max then
begin
max:=B[n,m];
t:=i;
end;
min:=B[n,m];
t:=1;
for i:=1 to 5 do
if B[n,m]<min then
begin
min:=B[n,m];
t:=i;
end;
writeln;
write ('����= ',max);
write ('���= ',min);
readln;


writeln ('��� ��室� ������ ���� �������!!! ');
repeat until keypressed;
end.