A = {{-1, -1, -1}, {0, 1, 0}, {0, 0, 
            1}};
Print["A=", A // MatrixForm];
\(\(Print[\*""\!\(A\^2\)="", 
        A . A // MatrixForm];\)\)
\(\(Print[\*""\!\(A\^2\)= IdentityMatrix[3] ="", 
        A . A // MatrixForm];\)\)
Print["A is periodic with a period of p =2"];

\(\(\(
\)\(\(B = {{0, 1, 0}, {0, 0, 
            1}, {\(-1\), \(-1\), \(-1\)}};\)

    \(Print["B=", B // MatrixForm];\)

    \(Print[\*""\!\(B\^2\)="", 
        B . B // MatrixForm];\)

    \(Print[\*""\!\(B\^3\)="", 
        B . \((B . B)\) // MatrixForm];\)

    \(Print[\*""\!\(B\^4\)="", 
        B . \((B . B . B)\) // MatrixForm];\)

    \(Print[\*""\!\(B\^4\)= IndentityMatrix[3]="", 
        B . \((B . B . B)\) // MatrixForm];\)

    \(Print["B is periodic with a period of p =4"];\)

    \)\)\)

c = {{0, 1, 0}, {-1, -1, -1}, {0, 0, 
            1}};
Print["C=", c // MatrixForm];
\(\(Print[\*""\!\(C\^2\)="", 
        c . c // MatrixForm];\)\)
\(\(Print[\*""\!\(C\^3\)="", 
        c . c . c // MatrixForm];\)\)
\(\(Print[\*""\!\(C\^3\)= IndentityMatrix[3]="", \((c . c . c)\) // 
          MatrixForm];\)\)
Print["C is periodic with a period of p =3"];