Text this: Potts model with next-nearest-neighbor ternary interactions on an arbitrary-order Cayley tree