## Quadratic nonresidue sum

Hello. I was just wondering if someone could help me out with the following problem.

Let p be an odd prime number. Let n be a quadratic nonresidue mod p. Prove that the sum over the divisors of n $d^{(p-1)/2}$ is congruent to 0 mod p.

So far, all that I've been able to do is show that each term in the sum is congruent to the legrande symbol (d/p), but now I'm stuck