4 If $0<x<\frac{\pi}{4}, A=\cos x^{\sin x^{\sin x}} ; B=\sin x^{\cos x^{\sin x}} ; C=\cos x^{\sin x x^{\cos x}}$. Then the size relationship of $A, B, C$ is $\qquad$ .
$4 B\cos x>\sin x>0$.
Since $y=a^{x}(0< a < 1)$ is a decreasing function, and $y=a^{x}(a>1)$ is an increasing function, we have $\sin x^{\cos x}<1$.
Therefore, $\cos x^{\sin x^{\sin x}}>\cos x^{\sin x^{\cos x}}$.
Given that $y=x^{a}, x>0, a>0$ is an increasing function, we have
$$
\cos x^{\sin x}>\sin x^{\sin x},
$$

Thus,
$$
\sin x^{\sin x^{\sin x}}\sin x^{\sin x}>0,
$$

which leads to
$$
\sin x^{\cos x^{\sin x}}<\sin x^{\sin x^{\sin x}} .
$$

From (1), (2), and (3), we get
$$
B<A<C \text {. }
$$