A square matrix A is said to be nilpotent if A^r=O for some integer r≧1.
Let A,B be nilpotent matrices, of the same size ,and assume AB=BA.Show that AB is nilpotent.

と言う問題です。
AもBもnilpotentで同じ大きさだというのだからその大きさをrとすると
(AB)^r=A^rB^r=O・O=O
として不正解だったのですが何処を間違っているのでしょうか?