A precise understanding of the flexibility of double stranded nucleic acids and the nature of their deformed conformations induced by external forces is important for a wide range of biological processes including transcriptional regulation, supercoil and catenane removal, and site-specific recombination. We present, at atomic resolution, a simulation of the dynamics involved in the transitions from B-DNA and A-RNA to Pauling (P) forms and to denatured states driven by application of external torque and tension. We then calculate the free energy profile along a B-to P-transition coordinate and from it, compute a reversible pathway, i.e., an isotherm of tension and torque pairs required to maintain P-DNA in equilibrium. The reversible isotherm maps correctly onto a phase diagram derived from single molecule experiments, and yields values of elongation, twist, and twist-stretch coupling in agreement with measured values. We also show that configurational entropy compensates significantly for the large electrostatic energy increase due to closer-packed P backbones. A similar set of simulations applied to RNA are used to predict a novel structure, P-RNA, with its associated free energy, equilibrium tension, torque and structural parameters, and to assign the location, on the phase-diagram,