In this paper, we generalize the Shirshovs Composition Lemma by replacing the monomial order for others. By using Groebner-Shirshov bases, the normal forms of HNN extension of a group and the alternating group are obtained.