By Paulo Prada and Guillermo Parra-Bernal RIO DE JANEIRO/SAO PAULO, Aug 26 (Reuters) - Two short years ago, Brazil had a terrible problem with its currency - it was far too strong. Local factories, unable to compete with Chinese imports made cheaper by the real's appreciation, were closing their doors. Fernando Pimentel, the trade minister and a close adviser to President Dilma Rousseff, declared that "Brazil has joined the team of countries with strong currencies" and urged industries to adapt to the new reality. Now, as global investors shed assets in emerging markets worldwide, Brazil's problem has abruptly turned upside-down. The real, along with India's rupee, has weakened more than any other major currency since May. Its tumble of 16 percent is forcing businesses, policymakers and consumers to prepare for consequences including inflation and costlier foreign financing. The decline has become another symbol of Brazil's fall from grace among investors and produced a severe case of whiplash among producers who complain that the basic pillars of Latin America's largest economy have constantly shifted under Rousseff's left-leaning government. Consequences will be felt everywhere from fuel pumps in Sao Paulo to retail outlets in Miami and New York City, where Brazilians were such prolific shoppers during the strong-currency years that the U.S. Travel Association referred to them as "walking stimulus packages" in 2012. The depreciation, Finance Minister Guido Mantega told a São Paulo newspaper over the weekend, "isn't good for anybody." "It changes the calculation for just about everyone," says Neil Shearing, chief emerging markets economist at Capital Economics in London. "What makes sense when you have a strong currency no longer does at a weaker level." Until this year, the real was on a tear. A decade-long period of steady growth appeared to put Brazil on the fast track toward first-world status, attracting record amounts of foreign investment and making the real one of the most coveted currencies in the world. Since May, when investors turned back toward developed markets amid bets of a U.S. recovery, the real has tumbled, trading Monday at 2.39 per dollar. Last week, it approached a five-year low which,compared with a peak of 1.54 per dollar in mid-2011, represents a fall of 37 percent. HIGHER COSTS AND HIGHER UNCERTAINTY The biggest threat of a weaker real is that of inflation, especially in a country with a long history of dramatic price increases. Annual inflation at the end of July was at 6.27 percent, just below the ceiling of the government's target band. With a weaker real, the cost of imported food, industrial supplies, consumer goods and other goods rises. Over the past year the price of wheat flour, a staple that is Brazil's biggest food import, spiked 29 percent according to central bank data. The higher costs pose operational challenges for companies with big dollar expenses and those who need affordable access to foreign capital. Airlines, who import jet fuel, are so worried that last week they asked Brazil's government for tax breaks. The government was surprised by the sudden fall, which could further complicate an expected re-election bid by Rousseff next year. Her approval ratings, until recently among the highest of any leader worldwide, fell sharply after mass protests in June against everything from poor public services to rising prices. Yet economists say there is nothing behind a weaker real that should have caught anyone off-guard. Demand for Brazil's commodity exports, one of the drivers of the boom, slowed as growth in China and other big customers cooled. A nascent recovery in the United States clearly meant that the dollar, suppressed in recent years by loose monetary policy now ending, would appreciate. "Any economic model would tell you that this was going to happen," says Marcio Garcia, an economist at the Catholic University in Rio de Janeiro and a visiting scholar at the MIT Sloan School of Management. "The question was when." SCRAMBLING That, of course, is what has Brazil scrambling. In an effort to shore up the real and stem volatility, Brazil's central bank last Thursday said it would intervene in foreign exchange markets with daily cash and currency swaps valued at $60 billion by the end of the year. "I'm glad they decided to go for this, but one thing I can tell you: it's too late," said Lawrence Pih, chief executive of Grupo Pacifico SA, which owns Latin America's largest wheat mill and is considering price hikes to handle the higher costs. Many other companies have taken measures to cope, too. Travel agencies are shrinking already small margins in order to limit the hike in air fares. Others, including state-run energy company Petroleo Brasileiro SA, or Petrobras, have adjusted accounting methods to smooth currency fluctuations on their balance sheets. The changes during the second quarter enabled Petrobras, most of whose debt is denominated in dollars, to avoid 8 billion reais of currency related charges. The company is also in the difficult position of having to import many fuels and sell them, because of government price controls, at a loss. Companies are also adopting new hedges against further volatility. According to data provided by Cetip SA Mercados Organizados, Latin America's largest securities clearinghouse, Brazilian companies increased their use of so-called non-deliverable forward contracts, which are settled in dollars, by 30 percent since the end of last year. The short-term pain of a weaker real could pose an opportunity in the long run. With slower growth, rising prices and stagnant investment, Brazil could finally have to tackle long-pending tax, labor and other reforms that business leaders argue are necessary to make the country more competitive. "The current scenario is unsustainable," says Marcos Mendes, an economist who advises Brazil's senate. "The way out of this is reform."