\[x^{2} - 5x + q = 0;\ \ \ x_{1} = 3\]
\[3^{2} - 5 \cdot 3 + q = 0\]
\[9 - 15 + q = 0\]
\[q = 6.\]
\[x_{1} + x_{2} = 5\]
\[3 + x_{2} = 5\]
\[x_{2} = 2.\]
\[Ответ:\ \ x_{2} = 2;\ \ q = 6.\]