People form their identity around their roles in life. Parent, sibling, partner. CEO, lawyer, artist. When one of those roles gets ripped away, it rocks the very life we know. This is exactly what happened to the titular characters of Grace and Frankie, who in their senior years, are two wives whose husbands left them for each other. Though initially polar opposites and nuclear enemies, Grace and Frankie form an impenetrable friendship and learn a lot about themselves as, side by side, they reshape their lives.

In the Harry Potter world, prescribed roles are of utmost importance at Hogwarts School of Witchcraft and Wizardry. The Sorting Hat ceremony is designed to steer students towards a role in the magic community best suited for them by placing them into one of four houses—Slytherin, Hufflepuff, Ravenclaw, or Gryffindor. As the professors tell their students, your house becomes your family. So, what if the Hanson-Bergstein family put on the Sorting Hat? (After Grace finishes criticizing the Hat's slovenly appearance, of course.) What house would each family member find themselves in?

Grace Hanson - Slytherin

Grace prides herself on being the WASP with the sharpest stinger. This martini-swilling cosmetics tycoon didn't earn her success by being nice. Slytherins are ruthless in the pursuit of their goals and don't suffer fools. If the mood struck, Grace would call you one right to your face. Nobody will ever catch Grace with even a single errant hair or wrinkle in her blouse. She is an ice-sculpture of Slytherin perfection.

RELATED: Grace and Frankie: The New Golden Girls

Yet, there's more to Grace than vodka and judgment. Being thrown together with Frankie in a set of humiliating circumstances saw Grace softening her sharp edges. But that doesn't mean Grace has lost her bite entirely. Sometimes people who live with their head in the clouds need a little Slytherin rain on their parade. Grace will always deliver.

Frankie Bergstein - Gryffindor

It may seem odd not to put Frankie in Hufflepuff, especially because it sounds like a strain of marijuana she would smoke. Alas, Frankie belongs in Gryffindor. She may be a hippie, but she's a fiery one.

RELATED: 10 Best TV Comedy Shows Featuring A Female Lead (On Air Right Now)

No matter how small, Frankie will devote herself to a cause at the drop of a paintbrush. The woman's boldness knows no bounds, from stealing a pack of cigarettes from a rude cashier to smearing blood all over herself in a business meeting. Frankie isn't afraid to let her freak flag fly, but sometimes she gets lost in her own whimsy. Examples include accidentally driving her baby granddaughter to the Mexican border and promising free donuts and vibrators to thousands of Vybrant clients. Despite her dottiness, there's a method to Frankie's madness and she is never afraid to be herself.

Robert Hanson - Ravenclaw

Being the voice of reason isn't always a fun job, but it's definitely one for a Ravenclaw. Robert is a retired lawyer and sometimes forgets he's not still in a courtroom. This doesn't always bode well for a marriage, especially one to sensitive Sol. When Sol wanted to go on a folk-music cruise, Robert dismissed the idea because he doesn't like folk music, completely missing the point that it's Sol's passion and would be a perfect opportunity for a romantic getaway.

RELATED: Netflix Original TV Shows To Be Most Excited About In 2019

However, there's more to Robert than being a killjoy. He genuinely loves Sol and is committed to making their life together work. Whether it's his partnership with Sol or his newfound love of musical theater, Robert can never be accused of being lazy. Ravenclaws fully commit to their endeavors and Robert is no exception. Even if that means driving Sol crazy by belting "Ya Got Trouble" for the millionth time.

Sol Bergstein - Hufflepuff

Though his loud shirts may give you a headache, Sol's a simple guy. He just wants everyone to be happy, like any Hufflepuff does. This is a beautiful idea on paper, but what Sol doesn't realize is that sometimes his doting nature makes things worse. While Grace and Robert completely cut the cord from each other, Sol handled Frankie with kid-gloves throughout their divorce. It came from love, but this babying behavior made it so much harder for Frankie to let go.

At the end of the day, Sol means well and he shows it. When he accidentally got Robert fired from Man A La Mancha—again, he was trying to do the right thing—Sol arranged for Robert to sing "The Impossible Dream", his dream song, in front of friends and family. Hufflepuff Sol's idea of the perfect evening would be a quiet home dinner with his dog and family. And nobody fighting.

Brianna Hanson - Slytherin

As Grace can't always be bothered to remember her kids' names, sometimes Brianna is simply referred to as "the mean one". Behind her blood-red lips, Brianna always has a zinger ready to fire at anyone who gets in her crosshairs. Several members of her family are admittedly afraid of her.

RELATED: Harry Potter: 10 Reasons Why Slytherin Is The Best House (And 10 Why Gryffindor Is)

While Brianna's meanness may not make her the best dinner guest, it certainly positions her to be Grace's natural successor in her company. Small talk and niceties take up valuable time, time a CEO doesn't have. Slytherins know this and so does Brianna. She's proud of her choices and accomplishments and isn't afraid to tell you. Right after she finishes verbally eviscerating your outfit.

Coyote Bergstein - Hufflepuff

Coyote may not have much...literally. He lives in a tiny house that he parks beside Mallory's curb. But Coyote's at peace with that. Besides his humble abode, he also works as a music teacher and he doesn't want for much else. Hufflepuffs are the most grateful of all the houses and nobody is happier to be alive than Coyote. As a former drug addict, Coyote has made some grievous missteps along his path but now happily walks the straight and narrow. He also shows appreciation to those who helped him find his feet, like when he gave Sol and Frankie each a cheque after they loaned him money several times.

RELATED: Harry Potter: 15 Things You Need To Know About Hufflepuff

As sweet as he is, Coyote isn't comfortable putting his foot down. He's a bit of a 'fraidy-cat when dealing with bigger personalities like Grace or Brianna. But as much of a pushover as he may be, while everyone else is fighting and scheming, Coyote's happy to just sit back and gaze at the ocean.

Nwabudike "Bud" Bergstein - Ravenclaw

It doesn't take a closet full of cardigans and khaki pants to tell you that Bud is the most responsible of the Hanson-Bergstein adult children. As a hyper-organized Type-A, Bud is the best fit to take over Sol and Robert's law firm. He also takes a leadership role in looking after his parents.

Sometimes Bud's fastidiousness can feel intrusive, like when he insisted Frankie and Grace hire a caregiver. Bud recently married Allison, the mother of his newborn son. Though a new marriage and child can be scary, nobody's more equipped than Ravenclaw Bud. He's assumed the role of babysitter since he was a kid himself.

Mallory Hanson - Hufflepuff

If Brianna is "the mean one", Mallory is "the nice one". If niceness is one of the first qualities mentioned about a person, that usually points to a Hufflepuff. Kindness and patience are must-haves for Mallory's living situation as a single mom with four kids. Between school projects, soccer practice, and the shenanigans of her dysfunctional family, Mallory doesn't have much time for her own personal endeavors.

An unfortunate Hufflepuff trait is that people tend to take advantage of them. Hence, Mallory works at her sister's company for free. While Mallory loves her kids, she's looking for an identity besides "Mom". House Hufflepuff is a great place to start. Then again, so is working for a paycheque.

NEXT: Mad Men Characters Sorted Into Their Hogwarts Houses