Renner-Teller effect in linear tetra-atomic molecules. I. Variational method including couplings between all degrees of freedom on six-dimensional potential energy surfaces.