The correct answer is:
Cl; it takes much more energy to pull an electron away from a valence shell that is nearly full.
Chlorine has a higher ionization energy than magnesium because chlorine is one electron short of having a complete valence shell, making its electrons more tightly held and requiring more energy to remove an electron. In contrast, magnesium has three electrons in its outer shell and is less tightly bound compared to chlorine, hence it has a lower ionization energy.