Everybody knows the names Sam and Diane. Predating iconic TV couples such as Ross and Rachel or Jim and Pam, the Cheers characters quickly became the topic of water-cooler conversations when the sitcom premiered in September 1989. Diane Chambers (Shelley Long) was a snooty grad student turned waitress whose cultured upbringing played in contrast with bar owner Sam Malone's (Ted Danson) salt-of-the-earth bar frankness.

As much as the strange bedfellow pairing set the stage for future onscreen relationships, even Sam and Diane were modeled after somebody else. "We wanted to create a show around a Katharine Hepburn-Spencer Tracy-type relationship,'' co-creator and executive producer James Burrows told the New York Times. ''She is uptown, he is downtown.''

Spencer Tracy Katharine Hepburn

Spencer Tracy and Katharine Hepburn in "Woman of the Year"

The show's producers referred to the couple as 'Tracy and Hepburn 2.0'

Hepburn and Tracy were renowned for their several "battle-of-the-sexes" romantic comedies of the 1940s and 1950s, including Woman of the Year, Adam's Rib, Pat and Mike and Desk Set. Much like the famous Hollywood duo of the time when the Production Code prohibited before marriage, Sam and Diane's initial interactions were also fraught with sexual tension.

"There's a similarity there," Cheers co-creator Les Charles explained to The Hollywood Reporter. "Tracy was down-to-earth, unpretentious, a little rough around the edges, whereas Hepburn always seemed to have a little elevation, an attitude in which she kind of looks down on Tracy."

His brother and co-creator, Glen Charles, added: "Like most relationships, they had periods of attraction and repulsion, jousting with sexual undertone. We enjoyed the banter." Executive producer Bill Steinkellner has even referred to Sam and Diane as "Tracy and Hepburn 2.0."

The writers struggled with how to deal with the characters' evolving relationship

At the end of Cheers' first season, Sam and Diane finally shared their first kiss. "We wanted to end the season with them kissing, figuratively or actually," Glen said to THR. "We thought the best way was to have a heated argument that leads to Sam saying, 'Are you as turned on as I am?' That set the tone for the relationship."

Once they consummated their relationship, the writers were faced with deciding how to approach the characters' changing dynamic. Instead of meeting in the middle, they continued to clash, with the tension only growing stronger. Producers even considered introducing a love triangle in the vein of screwball comedies from the 1930s and '40s, but their uphill relationship battle is what ultimately gave the pairing its comedy.

Sam and Diane Cheers

Shelley Long as Diane Chambers and Ted Danson as Sam Malone in "Cheers"

When Long left the show, the producers 'had to do a major retooling'

Sam and Diane's relationship, however, didn't last forever. Long's Cheers contract expired in 1987 following season 5, and the actress decided to leave the show to pursue a film career instead. The writers were forced to go back to the drawing board to keep the show afloat without its tent pole.

"When Shelley Long decided to leave, we had to do a major retooling," Burrows said,  according to the Chicago Tribune. "In a way, her departure has helped the series. This is not a slam at Shelley, who was an integral part of the show. But if she had continued, the series would have evolved into a domestic comedy because she and Sam would have eventually been married."

Les Charles admitted to THR they'd had "mixed emotions" about Long's departure: "On the one hand we were terrified and didn't know if the show could survive, but on the other hand, short of getting them married, we felt we had exhausted that relationship. We were ready for the challenge of writing for someone new."

Sam and Diane didn't end up together out of respect for their love-hate relationship

Kirstie Alley joined the series as Rebecca Howe in season 6, allowing Cheers to return to its original premise, according to Burrows. "Our initial concept was to establish a Tracy-Hepburn relationship — that marvelous mixture of romance and antagonism of two people in a competitive situation," Burrows told the Chicago Tribune. "We got away from that in the Sam-Diane scenes."

It seemed to work. With Alley on board, Cheers went on to run for an additional six years leading up to the May 1993 series finale following season 11. As much as the audience may have wanted Sam and Diane to be together, Steinkellner opined that continuing their storyline might have been to the show's detriment because "they weren't good for each other" and wouldn't have had the happiest marriage.

Long ultimately agreed. "Glen and Les wrote that last episode. I'm softy saying to them, 'Can't we get them together?' and they're looking at me like, give me a break kid," she recalled to THR. "This is supposed to be a love-hate relationship. That's what made their relationship fun to watch. It wasn't just they'd get over it or go to a therapist and work it out. No, these two people would be locked in mutual antagonism for their whole lives."