AddZ[k_] := 
      Table[Mod[i + j, k], {i, 0, k - 1}, {j, 0, k - 1}] // 
        MatrixForm
MultZ0[k_] := 
      Table[Mod[i*j, k], {i, 0, k - 1}, {j, 0, k - 1}] //  
        MatrixForm
MultZ[k_] := 
      Table[Mod[i*j, k], {i, k - 1}, {j, k - 1}] // MatrixForm

{AddZ[6], MultZ0[6]}

{AddZ[7], MultZ[7]}

PowerMod[a = 12345678, -1, p = 1234567891]

{g, {s, t}} = ExtendedGCD[a, p]

s*a + t*p

inv = Mod[s, p]

Solve[{a*x == 1, Modulus == p}, x]