VISEGRAD, HUNGARY, FEB. 15 -- Leaders of Poland, Hungary and Czechoslovakia today committed their countries to a new post-communist era in which they will help each other integrate into Western Europe while being careful not to annoy their giant eastern neighbor, the Soviet Union.

And in a show of support for the independence movement in Lithuania, President Vaclav Havel of Czechoslovakia said at a press conference following the meeting that his country would open "offices of representation" in the Soviet republic.

The meeting of the three leaders at an ancient castle on the banks of the Danube River comes as a delicate phase begins in the political and economic transformation of Eastern Europe's three most aggressively reforming countries.

Having peacefully replaced totalitarian regimes with freely elected leaders, the three nations are weathering severe recessions as they slowly build free-market economic systems.

At the same time, each country is warily watching what is euphemistically called the "uncertainty" in the Soviet Union, where the economy is collapsing, democratic reform has stalled and rebellious republics are being forcibly restrained.

"Our best chance of shortening the road to catching up with Western Europe is for us to mutually assist each other along the way," Havel said this week.

The leaders of Hungary, Poland and Czechoslovakia said in a communique that their free-market goals and routes toward achieving them "are largely the same."

"Our countries are different and follow different paths. But it would be vain for us to try separately to catch up with the West in a single great leap," Polish President Lech Walesa said here this week. "We must make this leap supporting each other."

The Visegrad agreement was described today as designed to help all three countries move toward their common goal of joining the European Community. With the de facto collapse of the Warsaw Pact and the Comecon trade bloc, leaders of the three countries said they do not want to create a new formal trade or military organization among themselves. Havel said, in reference to the European Community, "There is an all-European building being built."

The leaders, however, were at pains today to explain that their desire to move their nations' economies toward the West should not be interpreted as a slap in the face of their eastern neighbor.

Indeed, Hungarian Prime Minister Jozsef Antall went out of his way -- he essentially repeated the same words three times -- to make it clear that cooperation among his country, Poland and Czechoslovakia "does not represent anything that will be directed" against the Soviet Union.

The bloody military Soviet crackdown last month in the Baltic republics of Lithuania and Latvia, combined with President Mikhail Gorbachev's apparent retreat from democratic reform, seems to have sent shivers up the spines of political leaders in all three countries, each of which borders the Soviet Union.

But most senior diplomats in Poland, Czechoslovakia and Hungary appear to agree that there is only an extremely remote chance that the Soviet Union would try to reassert dominance over the former East Bloc.

There is not the same degree of unanimity, however, on the extent to which the three countries should stick their necks out in support of the independence claims of rebel Soviet republics.

That difference became clear at a press conference here today as Havel said that "Czechoslovakia supports the legal government and parliaments of the Baltic republics, and in the republic of Lithuania we shall create offices of representation."

Asked later if the establishment of such offices would be tantamount to recognizing the sovereignty of Lithuania, Havel said, "Essentially, yes."

Both Antall of Hungary and Walesa of Poland, however, were more evasive in stating their support for self-determination in the Baltics.

The Visegrad agreement represents a clear elevation in the relative standing of Poland as an economic partner. Until recent months, many officials in Budapest and Prague made no attempt to conceal their disdain for what they regarded as the desperate and even hopeless economic mess that Poland inherited from 45 years of communism.

But aggressive economic reform in Poland, along with explosive growth in private enterprise, appears to have dispelled Hungarian and Czechoslovak doubts about that country's capacity to integrate into a Western-style free market.