Recent comments by Rep.-elect Alexandria Ocasio-Cortez (D-N.Y.) have sparked a discussion over the cost of living in Washington for lawmakers. (Melina Mara/The Washington Post)

Sometimes a tumultuous election creates the elements in which both sides can come together to make some common-sense decisions that might seem unpopular.

Two of those possibilities should be considered next year in a bipartisan fashion: affordable housing for lawmakers and a significant pay raise for the legions of mid-level staff working countless hours on Capitol Hill.

Without any course correction, only the wealthy will be able to afford to run for Congress and only the already well-off will be able to staff the House and Senate.

The first issue received a jolt of attention with the election of Alexandria Ocasio-Cortez (D-N.Y.), the 29-year-old from the Bronx who has lamented not being able to rent an apartment in the District at least until January when she begins collecting the $174,000 annual salary given to members of Congress. That is a very fine salary, but most members must maintain two residences — and the D.C. housing market surge has turned a modest one-bedroom apartment near the congressional offices into a $2,000 monthly expense.

That creates a tight family budget, and any lawmaker with children approaching the college years can begin to see the incentive of ditching government work to become a lobbyist.

One potential remedy came from Rory Cooper, who left the Capitol four years ago after his boss, Eric Cantor (R-Va.), resigned as House majority leader. Cooper defended Ocasio-Cortez’s financial situation and suggested that Congress needs more lawmakers like her, Republicans and Democrats, to better understand the struggles of working Americans.

“We should all want to encourage more middle-class people to run for office, not less. And we should make Congress more accessible to them by eliminating the housing quandary,” Cooper wrote in an op-ed, prompted by a series of tweets last week suggesting Congress build dormlike housing for lawmakers.

This would cost many millions of dollars in upfront cash, but for an institution that doles out more than $1 trillion in federal spending each year, it would be a pittance.

It’s part of the cost of having a Congress that more resembles the diverse country it serves.

Lawmakers who opt to live in this housing could be charged a modest sum of $500 a month. Maybe limit the residents to those lawmakers in their first five years of service, and do away with the practice of sleeping in their offices.

Dozens of lawmakers already do this, essentially using their congressional office as a taxpayer-funded housing allowance.

Far more important, however, is the need to boost pay for congressional staff.

By tradition, no aide can receive more than a lawmaker, so the highest paid staff make a little less than the member’s $174,000.

But because of the fallout from the Great Recession, and the deep unpopularity of Congress, it’s been politically impossible to increase congressional pay.

That, in turn, has meant that staff pay has also been frozen for the last decade, creating a massive brain drain.

In 2008 the median salary on Capitol Hill was $47,662, according to LegiStorm, the nonpartisan for-profit company that researches congressional data.

A decade later, the median salary is $50,971.

If this pay had kept up with national inflation rates, the median salary would top $55,000. But that doesn’t even take into account the explosion in the expenses to live in the District.

Consider the demise of the group house.

Twenty years ago, the 100 block of C Street SE, half a block from the Cannon House Office Building, had at least four large townhouses filled with congressional staff and one with lawmakers. Rent, divided five or six ways, came in at under $500.

Those homes, now worth more than $1.5 million, no longer rent to 20-somethings. Instead, today’s younger staffer often crams into large apartment buildings that cost more than $2,500 for a two-bedroom.

LegiStorm’s analysis reveals a predictable trend: Fewer staff stay longer in those jobs, turning them over to less-experienced hands.

In 2001 and 2002, congressional staff in their 30s represented more than 34 percent of all aides on Capitol Hill, while 20-somethings made up 42 percent of staff.

By 2015 and 2016, people in their 30s represented just 27 percent of all congressional staff, while people in their 20s accounted for more than 55 percent of all aides.

The more salaries stayed flat, the more veteran staff have decided to leave working for Congress to, most likely, head to the private sector as they began to face decisions about marriage, children and home purchases.

The “lifer,” someone serving 20 or 30 years, is a dying breed.

People in their 40s used to represent more than 14 percent of all staff 18 years ago but have now have shrunk down to a little more than 9 percent.

The 20-somethings who remain should be applauded for their public service, but it’s time to start increasing their pay to make sure they will not feel driven away from the Capitol by the time they need to buy an engagement ring.

A vast majority of aides-turned-lobbyists consider their time in Congress the most riveting of their professional lives and, if there was an extra $10,000 or $20,000 in their annual pay, they might have stuck it out a few more years before joining the private sector.

Taking such politically sensitive steps — increasing funding on such an unpopular institution like Congress — requires leadership, and bipartisan leadership at that.

That’s why this month’s midterm elections offer such a chance for both sides to do the right thing, together, taking the political wind out of the hit.

Rep. Nancy Pelosi (D-Calif.) is the likely House speaker and Senate Majority Leader Mitch McConnell (R-Ky.) will continue running the Senate. They are among the most shrewd tacticians either party has had, and they both came up through the appropriations committees.

Those committees already took care of one injustice earlier this year, including nearly $14 million in funds designed to ensure every intern gets paid some salary.

“A student’s socioeconomic status should not be a barrier to getting real-world work experience,” Pay Our Interns says in its mission statement.

That nonprofit group, run by a former intern who had to wait tables on the side to live in D.C., shamed both parties into paying its interns to make sure that kids from all socioeconomic backgrounds could get their foot in the door through intern programs in Congress.

Now it’s time for Congress to do the same with the rest of its workforce.

Read more from Paul Kane’s archive, follow him on Twitter or subscribe to his updates on Facebook.