Analytical solution and applications of three qubits in three coupled modes without rotating wave approximation