22. Use $m(m \geqslant 2)$ colors to paint the 6 faces of a cube, with each face painted...a different color so that adjacent faces have different colors, find the number of distinct colorings of the cube.

将上面的文本翻译成英文，请保留源文本的换行和格式，直接输出翻译结果。

---

22. Use $m(m \geqslant 2)$ colors to paint the 6 faces of a cube, with each face painted...a different color so that adjacent faces have different colors, find the number of distinct colorings of the cube.
22. $\frac{1}{24} m(m-1)(m-2)\left(m^{3}-9 m^{2}+32 m-38\right)$.