39999999997 in words is written as :

Billion Million Thousand Nine Hundred and Ninety Seven