While the president of the United States was busy tweeting memes and insulting television personalities this weekend, a video circulated showing the chief justice of the US Supreme Court, John Roberts, encouraging a new generation of young men to be humble and generous.

As the commencement speaker at his son Jack’s ninth-grade graduation at the Cardigan Mountain School in rural New Hampshire last month, Roberts delivered a humorous speech, telling the new graduates that life would inevitably throw a number of curveballs their way.

How each boy responded would be a measure of who they are as people, he added.

“I wish you bad luck, from time to time, so that you will be conscious of the role of chance in life and understand that your success is not completely deserved, and the failure of others is not completely deserved either,” Roberts said. “And when you lose, as you will from time to time, I hope every now and then that your opponent will gloat over your failure, as a way to understand the importance of sportsmanship. I hope you’ll be ignored, so you understand the importance of listening to others, and I hope you will have just enough pain to learn compassion.”

Roberts told the graduates that they just gotten through the easiest parts of their lives. And while the road ahead would not be as easy, it would be full of moments to learn from, he said.

“Whether I wish these things or not, they’re going to happen,” he said. “And whether you benefit from them or not will depend upon the ability to see the message in your misfortunes.”

Roberts’s speech quickly won accolades for its focus on humility, with Robert Barnes at the Washington Post saying the chief’s justice’s commencement speech was more important than any decision he had handed down from the bench this year.

LA Times editorial writer and former Supreme Court reporter Michael McGough drew a sharp distinction between the speech and the recent antics of President Trump.

“Much of what Roberts said could also plausibly come from the mouth of a president — but not, unfortunately, this one,” McGough wrote.

Cardigan Mountain is an all-male junior prep school with an annual tuition costing about as much as that of most universities. But Roberts used his address to remind students that their privileged position comes with a recognition, and responsibility.

“You are also privileged young men, and if you weren’t privileged when you came here, you are now, because you have been here,” he said. “My advice is don’t act like it.”

As students made their way to their new high schools, Roberts encouraged them to introduce themselves to the staff there, especially “to the person who is raking the leaves, shoveling the snow, or emptying the trash. Learn their name, and call them by their name during your time at school.”

He told graduates to say hello to everyone they meet, even if they thought it awkward to start out with — and to write their old teachers at Cardigan handmade thank-you notes.

Roberts dispensed a lot of advice throughout his 15-minute speech, but there was one area where he admitted he couldn’t be helpful.

“Most of you will be going to a school with girls. I have no advice for you,” he said, to laughter and applause.