The integral values of ′a′ for which the equation cos2x−(a2+a+5)|cosx|+(a3+3a2+2a+6)=0 has real solution(s).