The LCM and GCD of the two polynomials are x+1 and x31. If one of the polynomials is x2+x+1, then the other polynomial is