Let $p$ be the number of all triangles that can be formed by joining the vertices of a regular polygon $P$ of $n$ sides and $q$ be the number of all quadrilaterals that can be formed by joining the vertices of $P$. If $p+q=126$, then the eccentricity of the ellipse $\frac{x^2}{16}+\frac{y^2}{n}=1$ is: