It was graduation day at the Naval Academy, 1958. Standing among the graduates was a man with one of the most famous names in the Navy -- John S. McCain III.
There were McCain ships and a McCain airfield -- named after the man's father and grandfather, both war-time commanders and the first father and son to become four-star admirals.
And to the young McCain they bequeathed their military code of honor.
This John McCain, the war hero, would go on to become the Republican nominee for the president of the United States. He once wrote, "Earning the respect of my father and grandfather has been the most lasting ambition of my life."
"I work at it every day," McCain told ABC News' Diane Sawyer when she pointed out the quotation.
It's a big legacy, especially for a boy who was initially hesitant to pursue it.
"I was just … a bit resentful that my path had been charted for me, either intentionally or unintentionally, by my parents," McCain said. "In other words, I remember when my dad's friends would be over when I was very young, and they'd say, 'What class is he gonna be?' Not, 'Was he goin' in the Naval Academy?'"
When Sawyer asked McCain what the number 894 meant to him, he chuckled.
"It means, I think, fifth from the bottom of my class at the Naval Academy," he said.
"Could I also point out that -- it's not important -- but a lot of the class standing was determined by the number of demerits that you acquired," he said, again with a laugh.
The behavioral demerits were eared by a smart, scrappy kid who had grown up backing off bullies as he moved around to 20 schools because of the Navy.
When he landed at an upscale Episcopal prep school outside Washington, D.C., he was a passionate reader who loved military history and poetry. He had his father's favorite poem memorized -- Robert Louis Stevenson's "Requiem."
But the short kid was also the kind of wrestler who could pin an opponent in 37 seconds.
And at the Naval Academy -- in an act of heresy -- he would take on upperclassmen if they tried to bully underlings, his name a trump card.
"When he saw one of the upperclassmen picking on one of the Filipino mess men in our mess hall, John just stood up and said 'You knock that off. That's not fair,'" Adm. Chuck Larsen said.
"And the 1st class man said, 'What's your name, mister?'" his former roommate Frank Gamboa said. "And John replied, 'Midshipman McCain. What's yours?'"
Along with McCain's combative DNA came a taste for risk.
"What you see with McCain is a man who is driven by a sense of duty, honor and country, but who has a kind of subversive sense about him," Jon Meacham of Newsweek magazine said. "He loves to be in the room, but he also loves to roll the grenade."
Gamboa said with a laugh, "If you didn't want to live close to the edge, then you didn't go to a party with John McCain."
His friends called him "John Wayne McCain" -- for his swagger at parties and all the girls. Some stories became the stuff of legend.
Gamboa remembered traveling with McCain to Rio de Janeiro when the would-be senator met a Brazilian model.
"It's just one of those idyllic experiences that I'll always remember and cherish," McCain said. "The telling goes -- grows much better with age."
One night at the Naval Academy, McCain started a water fight in his slovenly room, prompting a knock on the door.