In 1978 Sakoda and Sipser raised the question of the cost, in terms of size of representations, of the transformation of two-way and oneway nondeterministic automata into equivalent two-way deterministic automata. Despite all the attempts, the question has been answered only for particular cases (e.g., restrictions of the class of simulated automata or of the class of simulating automata). However the problem remains open in the general case, the best-known upper bound being exponential. We present a new approach in which unrestricted nondeterministic finite automata are simulated by deterministic models extending two-way deterministic finite automata, paying a polynomial increase of size only. Indeed, we study the costs of the conversions of * This work contains, in an extended form, some material and results which were previously presented in a preliminary form in conference papers [20] and [5].