Anselm of Canterbury:
Proslogion
Therefore it is just in relation to You, O just and benevolent God, both when You punish and when You pardon. Truly, then, ‘all the ways of the Lord are mercy and truth’ and yet ‘the Lord is just in all his ways’. And without any inconsistency at all, since it is not just for those to be saved whom You will to punish, and it is not just for those to be damned whom You will to pardon. For that alone is just which You will, and that is not just which You do not will. Thus, then, Your mercy is derived from your justice since it is just that You are so good that You are good even in forgiving.
Proslogion