Solution (source code)

= Solution

An <integral basis> is a $\mathbb Z$-<basis> of the <ring of integers> $\mathcal O_K$; it consists of $n$ algebraic integers and is also a $\mathbb Q$-<basis> of $K$.

The lattice $M$ has finite index $h=[\mathcal O_K:M]>1$. Choose a prime $p\mid h$. The finite <abelian group> $\mathcal O_K/M$ has an element of order $p$, represented by $\alpha\in\mathcal O_K\setminus M$. Thus
$$
p\alpha=\sum_{j=1}^nc_jw_j\in M.
$$
If all $c_j$ were divisible by $p$, cancellation in the characteristic-zero <field> would put $\alpha$ in $M$, a contradiction. The <discriminant-index formula for an integral lattice> gives
$$
\Delta^2(M)=h^2\Delta^2(K),
$$
where $\Delta^2(K)$ is an <integer>. Hence $p^2\mid\Delta^2(M)$, and the required integral element is $\alpha=p^{-1}\sum_jc_jw_j$.