[Theorem of Three Perpendiculars]

The base of the pyramid is a rectangle with an area of S. Two lateral faces are perpendicular to the base plane, while the other two are inclined to it at angles of $30^{\circ}$ and $60^{\circ}$. Find the volume of the pyramid.
Suppose the planes of two opposite lateral faces of the given pyramid $PABCD$ are perpendicular to the plane of the base $ABCD$. Then each of these planes contains a line perpendicular to the plane of the base. These lines are parallel because they are perpendicular to the same plane. Moreover, these two planes pass through opposite sides of the rectangle. Thus, two intersecting lines in one of these planes are respectively parallel to two intersecting lines in the other plane. Therefore, these planes are parallel, which is impossible since they have a common point $P$.

Let the adjacent lateral faces $ABP$ and $APD$ be perpendicular to the plane of the base. Then the line $AP$ of their intersection is also perpendicular to the plane of the base. Since $AB \perp BC$, by the theorem of three perpendiculars, $BP \perp BC$. Therefore, the angle $ABP$ is the linear angle of the dihedral angle between the planes of the faces $BPC$ and $ABCD$. Similarly, we can prove that $ADP$ is the linear angle of the dihedral angle between the planes of the faces $DPC$ and $ABCD$.

Let $\angle ABP = 60^\circ$, $\angle ADP = 30^\circ$. Denote $AB = a$, $AD = b$, $AP = h$ - the height of the pyramid. Then

\[
\begin{aligned}
& h = AB \cdot \tan \angle ABP = a \cdot \tan 60^\circ = a \sqrt{3} \\
& h = AD \cdot \tan \angle ADP = b \cdot \tan 30^\circ = b / \sqrt{3}
\end{aligned}
\]

Therefore, $h^2 = (a \sqrt{3}) \cdot (b / \sqrt{3}) = ab = S$. Hence, $h = \sqrt{S}$. Therefore,

## Answer

The problem