Generalization of trinification to theories with 3N SU(3) gauge groups