Solution (source code)

= Solution

Write $x=\pi^ru$ with $r\in\mathbb Z$ and $u\in\mathcal O_K^\times$. If $x$ is an $m$th power, then $m$ divides $r$. Divisibility by infinitely many $m$ forces $r=0$, so $x$ is a unit.

Conversely, if $m$ is coprime to both the residue characteristic $p$ and $q-1$, exponentiation by $m$ is an automorphism on the finite residue-unit group and on every <principal unit> quotient; equivalently, use Hensel's lemma on $Y^m-u$. Hence every unit is an $m$th power for infinitely many such $m$. Therefore
$$
P=\mathcal O_K^\times,
$$
as recorded by <elements that are powers of infinitely many degrees in a local field>.