# Maximize Probability on a Weighted Coin

Daniel has a weighted coin that flips heads $$\frac{2}{5}$$ of the time and tails $$\frac{3}{5}$$ of the time. If he flips it $$9$$ times, the probability that it will show heads exactly $$n$$ times is greater than or equal to the probability that it will show heads exactly $$k$$ times, for all $$k=0, 1,\dots, 9, k\ne n$$.

If the probability that the coin will show heads exactly $$n$$ times in $$9$$ flips is $$\frac{p}{q}$$ for positive coprime integers $$p$$ and $$q$$, then find the last three digits of $$p$$.

×