Tina is a top student who/whom/that the school gave a medal to for winning the writing competition.
Tina is a top student to whom the school gave a medal for winning the writing competition.
Tina is a top student who/whom/that the school gave a medal to for winning the writing competition.
Tina is a top student to whom the school gave a medal for winning the writing competition.