Let $ABCD$ be a square with side 1. On the sides $BC$ and $CD$ are chosen points $P$ and $Q$ where $AP$ and $AQ$ intersect the diagonal $BD$ in points $M$ and $N$ respectively. If $DQ\neq BP$ and the line through $A$ and the intersection point of $MQ$ and $NP$ is perpendicular to $PQ$, prove that $\angle MAN=45^\circ$.
Problem
Source: I International Festival of Young Mathematicians Sozopol 2010, Theme for 10-12 grade
Tags: geometry, square