The ranking of the elements would be as:
Electron affinity, in simple words can be described as the amount of energy that is released when an electron is added to the outermost or valence shell of an atom and which results in the formulation of an ion with negative charge.
If we look at the periodic table, the values of electron affinity decreases from top to bottom in a group and increase from left to right across a period. This is because when we move from top to bottom in a group, the energy levels increase which lower the pull of nucleus for outer most shell. However, when we move from left to right in a period, the number of energy levels stay same, but the nucleus exerts greater pulling force on the outer most shell electrons that results in greater attraction. so, low amount of energy is released when an electron is added to the valence shell of atom.
Hope it helps!