  S stars are transition objects between M-type giants and carbon stars on the
asymptotic giant branch (AGB). They are characterized by overabundances of
s-process elements. Roughly half of them are enhanced in technetium (Tc), an
s-process element with no stable isotope, while the other half lack technetium.
This dichotomy arises from the fact that Tc-rich S stars are intrinsically
producing s-process elements and have undergone third dredge-up (TDU) events,
while Tc-poor S stars owe their s-process overabundances to a past pollution by
a former AGB companion. Our aim is to analyse the abundances of S stars and
gain insights into their evolutionary status and on the nucleosynthesis of
heavy s-process elements taking place in their interior. In particular, the
location of extrinsic and intrinsic S stars in the HR diagram will be compared
with the theoretical onset of the TDU on the thermally-pulsing AGB. A sample of
19 S-type stars was analysed by combining HERMES high-resolution spectra,
accurate Gaia Data Release 2 (GDR2) parallaxes, stellar-evolution models, and
newly-designed MARCS model atmospheres for S-type stars. Combining the derived
parameters with GDR2 parallaxes allows a joint analysis of the location of the
stars in the Hertzsprung-Russell diagram and of their surface abundances. For
all 19 stars, Zr and Nb abundances are derived, complemented by abundances of
other s-process elements for the three Tc-rich S stars. These abundances agree
within the uncertainties with nucleosynthesis predictions for stars of
corresponding mass, metallicity and evolutionary stage. Most extrinsic S stars
lie close to the tip of the red giant branch (RGB), and a few are located along
the early AGB. The location of intrinsic S stars in the HR diagram is
compatible with them being thermally-pulsing AGB stars.
