Write a program to find the names of all candidates who have scored the second highest marks.
Implement second_highest_candidates(candidates), where candidates is a list of [name, marks] pairs. Return a list of names whose marks equal the second-highest distinct score, preserving input order; return [] when fewer than two distinct scores exist.
def second_highest_candidates(candidates):