From the Super Mario Wiki
The Magical Typewriter is a typewriter that first appears in the CD-ROM version of Mario Teaches Typing. It also appears in the sequel, Mario Teaches Typing 2 whose story is a retelling of the first game's.
The Magical Typewriter is featured in cutscenes that play in various parts of the game. The story involves Mario typing on the Magical Typewriter. However, he poorly types on it, and the typewriter explodes. Mario and Luigi go on an adventure to recover the missing pieces. They eventually recover the missing pieces, and Mario can accurately use the Magical Typewriter. He types in a sentence, which spawns a large object to collapse from the sky and onto Bowser's Castle: a giant green ! Block in the first game or a giant typewriter in its sequel.
The sentence entered by Mario to destroy Bowser's Castle is different between both games: in the first game, it is "Now is the time for all good men to come to our aid and destroy Bowser's castle!", which was changed to "Koopa Troopa Paratroopa Bowser's castle go kablooka!" in the second game.