Despite their close companionship, Frodo and Samwise serve as foils for each other throughout the novel. Frequently, Sam's friendly but simple-minded attitude contrasts with that of the more introspective and hesitant Frodo. This contrast of characters is evident in a scene in which both hobbits compose very different poems memorializing the apparent death of Gandalf, with Frodo going first:
He stood upon the bridge alone
and Fire and Shadow both defied;
his staff was broken on the stone,
in Khazad-dûm his wisdom died.
"Why, you’ll be beating Mr. Bilbo next!" said Sam.
"No, I am afraid not," said Frodo. "But that is the best I can do yet."
"Well, Mr. Frodo, if you do have another go, I hope you’ll say a word about his fireworks," said Sam. "Something like this:
The finest rockets ever seen:
they burst in stars of blue and green,
or after thunder golden showers
came falling like a rain of flowers.