We establish a universal approach to solutions of the word problem in the varieties of di-and tri-algebras.This approach,for example,allows us to apply Gr(o)bner Shirshov bases method for Lie algebras to solve the ideal membership problem in free Leibniz algebras (Lie di-algebras).As another application,we prove an analogue of the Poincaré-Birkhoff Witt Theorem for universal enveloping associative tri-algebra of a Lie tri-algebra (CTD1-algebra).