FRANKFURT — Deutsche Bank and Commerzbank abruptly called off their merger talks Thursday, saying they concluded that the perils of trying to forge a megabank with international clout outweighed the potential benefits.

But while Germany’s two largest banks answered one question that had preoccupied the country in recent weeks, they raised another: What next?

The status quo is not an option for either Frankfurt bank. Both suffer from urgent problems that include meager profitability, excessive labor costs and a shift to online banking that they have been slower to embrace than their competitors.

Europe has too many banks for too few customers, and marginally profitable lenders are a source of economic weakness. For all its flaws, the failed quest to merge Deutsche Bank and Commerzbank was an attempt to attack that fundamental problem.