Actually by trigo i did this way:
Let x=cos(theta) x cos(2theta) x cos(3theta) x ...cos(999theta)
Let y= sin(theta) x sin(2theta) x sin(3theta) x .....sin(999theta)
now xy=cos(theta)sin(theta) x sin(2theta)cos(2theta) x ...cos(999theta)sin(999theta)
now 2999xy=sin(2theta) x ........sin(1998theta)
Now sin(1998theta)=sin(theta) n so on..
We get 2999xy=y
So x=1/2999.