<s>[INST] What is the principal root of $\sqrt{-i}$? Where is the mistake in this solution?

$$\sqrt{-i}=\sqrt {\cos \frac{3 \pi}2+i\sin \frac{3 \pi}2}=\cos \frac{3 \pi}4+i\sin \frac{3 \pi}4=-\frac{\sqrt 2}2+i \frac{\sqrt 2}2$$

WA gives me different result:

$$\frac{\sqrt 2}2-i \frac{\sqrt 2}2$$

Why the principal root must be equal to $\frac{\sqrt 2}2-i \frac{\sqrt 2}2$?
I used Moivre's formula. But I dont know. How can I must choose value of $k$ in Moivre's formula? I chose $k=0$.
$$z=r\left(\cos x+i\sin x\right)$$
$$z^{\frac 1n}=r^\frac1n \left( \cos \frac{x+2\pi k}{n} + i\sin \frac{x+2\pi k}{n}\right)$$
 [/INST] Solve the quadratic equation
$$x^2=-i=e^{-i\pi/2}\implies x=e^{-i\pi/4+ik\pi},\; k=0,1$$
</s>