In a review about Ninja Gaiden, the author pointed out that the Ninja always says: "What the...?" to express his emotion.
So I think that there is noway to complete this sentence without making it rude & uneducated?
- What the hell/heck?!
- What the f-word?
- What the what?! (That's what the cartoon character Gumball said - What's that even mean, it's meaningless so I count it as uneducated)
So if you were the Ninja Gaiden and you were forced to complete what you had said (you had said "What the...?!" to express your anger/surprise/scare/... ), How would you complete to make sure you were a polite & educated person.