Jennifer Lopez has had quite a busy summer. She simultaneously entertained audiences on her It’s My Party tour and promoted her upcoming movie Hustlers. She’s also hard at work planning a wedding to fiancé Alex Rodriguez. But somewhere in the middle of all that, she found time to meet Associate Justice of the U.S. Supreme Court Ruth Bader Ginsburg.

While they were together, J.Lo asked RBG if she knew the secret to a happy marriage. Naturally, she did. And now, Ginsburg is sharing her wisdom with the rest of us. She told the story over the weekend at the Library of Congress’ National Book Festival in Washington, D.C., and Lopez shared the video on Instagram.

“I was called about a month or so ago by Jennifer Lopez, and she said she would like to meet me and introduce her fiancé Alex Rodriguez,” Ginsburg said. “So they came to chambers, and we had a very nice visit. She mostly wanted to ask if I had any secret about a happy marriage.”

RGB proceeded to share her secret to a happy marriage, which she learned from her mother-in-law on her wedding day.

J.Lo loved RGB’s marriage advice, but she loved another piece of advice even more.

Lopez asked Ginsburg what she and Rodriguez can do to help unite our divided country. She shared Ginsburg’s advice in her Instagram caption.

There you have it: The secret to a happy marriage, Ruth Bader Ginsburg-style.