I drank a cup of coffee before leaving.
The gerund is used after the preposition before.
Ответ: leaving