Is there a way out of the partial shutdown of the government? Yes, there is. But it will require both sides giving up a lot.

First, give President Trump not the $5 billion for a partial wall, which may never be completed, but the supposed $25 billion for a complete wall on the southern border with Mexico. The appropriation can be labeled “Border security,” so the word “wall” doesn’t have to be mentioned at all.

However, in politics, as in much of life, you have to give up something to get something. The other side of the wall is a path to citizenship for the estimated 11 million  undocumenteds who live in the United States.

Now Republicans might fear that if that happens, they will never win another national election. But Ronald Reagan signed the Simpson-Mazzoli bill in 1986 giving amnesty — there, I’ve said the word — to millions of undocumented workers at the time. So the Republicans never won another election? Tell that to George H.W. Bush, George Bush and now President Trump.

Curiously, when Saint Ronald attached his signature, there were few if any condemnations from his fellow Republicans. That’s because the labor of the undocumenteds was needed for hundreds of thousands small and large businesses, most of whom supported Republicans.

Will they vote 90-10 for Democrats versus Republicans, as the African-American community often does? Research by Pew and others shows that, while Hispanics — the vast majority of undocumented aliens — favor Democrats, they give 30 percent to 35 percent of their support to Republicans. This in spite of President Trump insulting Hispanics on innumerable occasions. When there is a candidate saying nice things about Hispanics, as George Bush did in running for governor of Texas, the figure can go to 40 percent and above.

We now have something that President Reagan did not have in 1986 — E-Verify. This electronic system makes sure that a Social Security number, used for getting employment, is valid. Some people wonder how can undocumented residents survive economically if they can’t supply a valid Social Security card? This is because there are millions of fake cards in circulation. They would be detected with E-Verify. The latest example of fake cards took place in one of President Trump’s golf resorts, where some of the help didn’t have to supply fake cards — they were allegedly given out by managers. This probably has taken place millions of times in less publicized circumstances.

So along with the path to citizenship, E-Verify would have to be used in all but the smallest businesses. This would ensure that everyone in the country was here legally.

Another factor that did not exist in 1986 is that Republicans want something — the wall — that only Democrats can supply. In the past, as in the 2008 and 2012 Republican platforms, there were the usual cliches about improving border security, but nothing about a wall stretching thousands of miles. Now there is a demand, which can only be satisfied by some sort of a deal, by the Great Dealer himself.

Conditions could be attached to the path to citizenship. For example, no felony convictions in the last five years, pay a fine for entering the country illegally — a misdemeanor, not a felony. But the principle of millions of tons of concrete and steel in exchange for bringing millions of people out of the shadows seems like a fair deal.

Former Rep. Luis Gutierrez, D-Illinois, who battled for undocumented workers for many years, says that Democrats will have to pay a “ransom” to solve the problem. Whether you call it a ransom, a bribe or a compromise, it’s a way to solve a festering problem that has gone on for decades.