Role of fluctuations in density wave and superconductivity of quasi-one-dimensional conductors