5039 in words is written as :

Five Thousand Thirty Nine