When the thermoelectric semiconductor tin monoselenide is doped with antimony, it switches between p-type and n-type as doping increases.