procedureMATRIX(A,LAMBDA,N,P,S);integerN,P;arrayA,LAMBDA;stringS;begin;integerI,J,A,B;NLCR;PRINTTEXT(S);A:=1;B:=(ifN>6then6elseN);NLCR;AA:NLCR;NLCR;NLCR;NLCR;ifP=1thenbegin;forJ:=Astep1untilBdoPRINT(LAMBDA[J]);NLCRend;forI:=1step1untilNdobegin;NLCR;forJ:=Astep1untilBdoPRINT(A[I,J])end;ifB<>Nthenbegin;A:=B+1;B:=(if(B+6)>NthenNelseB+6);gotoAAend;NLCRendMATRIX;