Artificial intelligent assistant

Sophomore + Junior + Senior A class is attended by $n$ sophomores, $n$ juniors and $n$ seniors. In how many ways can these students form $n$ groups of three people each if each group is to contain a sophomore, a junior, and a senior?

First, line up the sophmores in any way. Next, line up the juniors across from the sophmores in any one of $n!$ ways. After that, line up the seniors across from the juniors in any one of $n!$ ways. The result is a total of $(n!)^2$ ways.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 4a70366c0e448eb5e5392db0b29aaa19