6.7. (New York, 78). Find all pairs of natural numbers $A \neq B$ for which the system

$$
\left\{\begin{array}{l}
\cos A x+\cos B x=0 \\
A \sin A x+B \sin B x=0
\end{array}\right.
$$

has a solution.
6.7. Let the given system have a solution \( x \) for some sought values of \( A, B \). From the first equation of the system, we obtain that \( \cos B x = -\cos A x \), hence \( \sin B x = \varepsilon \sin A x \), where \( \varepsilon \in \{-1 ; 1\} \). Then from the second equation of the system, we get

\[
(A + \varepsilon B) \sin A x = 0
\]

Since \( A, B \in \mathbf{N} \) and \( A \neq B \), then \( A + \varepsilon B \neq 0 \). Therefore, \( \sin A x = 0 = \sin B x \), from which we have

\[
A x = k \pi, \quad B x = n \pi \quad (k, n \in \mathbb{Z})
\]

Substituting these values of \( A x \) and \( B x \) into the first equation of the system, we find that the numbers \( k \) and \( n \) have different parity. Excluding the variable \( x \), we obtain the condition \( B k = A n \). Since the parity of the numbers \( k \) and \( n \) is different, the number 2 has different exponents in the prime factorizations of the numbers \( A, B \in \mathbf{N} \). Conversely, if \( A = 2^l p, B = 2^m q \), where \( l, m \in \mathbf{Z}^+ \), \( l \neq m \), \( p, q \in \mathbb{N} \), and \( p, q \) are odd, then the original system has a solution \( x = \pi / 2^s \), where \( s = \min(l ; m) \).