Here's the answer:
“tenho de escrever uma dissertação”
Watch a real native speaker say it:
Here's how it sounds in a textbook:
Fun fact: the hundreds of thousands of people learning Portuguese with Memrise get this phrase correct 95.57% of the time!