Ewa Jaworska has been a teacher since 2008 and loves working with young people. But the low pay is leaving her demoralized. She even has to buy her own teaching materials sometimes and is disheartened by the government using schools to promote conservative ideas which she sees as backward.

Like many other Polish teachers, she is considering a career change.

“I keep hoping that the situation might still change,” said the 44-year-old, who teaches in a Warsaw high school. “But unfortunately, it is changing for the worse, so only time will tell if this year will be my last.”

Problems are mounting in schools in Poland, with a teacher shortage growing worse and many educators and parents fearing that the educational system is being used to indoctrinate young people into the ruling party’s conservative and nationalistic vision.

It’s very much the same in Hungary. Black-clad teachers in Budapest carried black umbrellas to protest stagnant wages and heavy workloads on the first day of school Thursday. Teachers’ union PSZ said young teachers earn a “humiliating” monthly after-tax salary of just 500 euros (dollars) that has prompted many to walk away.

Thousands of people marched in solidarity with teachers Friday in Budapest, voicing the view that the teachers’ low compensation is linked to the authoritarian direction of Prime Minister Viktor Orban’s government.

“Free country, free education!” they shouted.

Teacher shortages could hardly come at a worse time, with both countries trying to integrate Ukrainian refugees. It’s particularly challenging for Poland, where hundreds of thousands of school-aged Ukrainian refugees now live.

Nearly 200,000 Ukrainian students, most of whom do not speak Polish, already entered Polish schools after the war began Feb. 24. The education minister has said the overall number of Ukrainian students could triple this coming school year, depending on how the war unfolds.

Andrzej Wyrozembski, the principal of the high school in Warsaw’s Zoliborz district where Jaworska works, has set up two classes for 50 Ukrainians in his school. He said his Ukrainian students who arrived in the spring are quickly learning Polish, a related Slavic language. The real difficulty is finding teachers, particularly for physics, chemistry, computer science and even for Polish.

Across central Europe, government wages haven’t kept pace with the private sector, leaving teachers, nurses and others with far less purchasing power.

The situation is expected to grow worse as many teachers near retirement and ever fewer young people choose the poorly paid profession, especially when inflation has exploded to 16% in Poland and nearly 14% in Hungary.

According to the Polish teachers’ union, schools in the country are short 20,000 teachers. Hungary, with a much smaller population, has a 16,000-teacher shortage.

“We don’t have young teachers,” said Slawomir Broniarz, the president of the Polish Teachers’ Trade Union, or ZNP, citing the starting salary of 3,400 zlotys ($720) pretax as the key reason.

Polish Education Minister Przemyslaw Czarnek has disputed the figures, saying teacher vacancies were closer to 13,000, adding it isn’t a huge number in proportion to the 700,000 teachers nationwide. He accuses the union and political opposition of exaggerating the problem.

Many educators strongly oppose the conservative ideology of the nationalist government and Czarnek himself, viewing him as a Catholic fundamentalist. His appointment in 2020 sparked protests because he had said LGBTQ people aren’t equal to “normal people” and that a woman’s main role is to have children.

Criticism has recently focused on a new school textbook on contemporary history. It has a section on ideologies that presents liberalism and feminism alongside Nazism. A section interpreted as denouncing in-vitro fertilization was so controversial that it was removed.

In Hungary, Erzsebet Nagy, a committee member of the Democratic Union of Hungarian Teachers, said teachers have been leaving the profession “in droves.”

“Young people aren’t coming into the profession, and very few of those who earn a teaching certificate from high school or university go on to teach,” said Nagy. “Even if they do, most of them leave within two years.”

Hungarian unions have also complained about the centralization of the country’s education system. Curriculums, textbooks and all decision-making are controlled by a central body formed in 2012 by Hungary’s nationalist government.

“Our professional autonomy is continually being eliminated,” said Nagy. “We have no freedom to choose textbooks. There are only two to choose from in each subject and both are of terrible quality. They’ve blocked the possibility for a free intellectual life.”

Worried about their children’s futures, families are rejecting public schools. New private schools are opening but they still can’t meet the demand.

Polish architect Piotr Polatynski was ready to take a second job just to pay private school tuition for his fourth-grade daughter. But as a new school year began this week, a lack of places in private schools forced him and his wife to send her back to a public neighborhood school, which they feel isn’t providing the kind of education his daughter deserves.

He still hopes a spot might open up somewhere as he fumes over the state of the education system.

“We don’t believe that the current government is capable of making changes that would encourage young people to enter the teaching profession and bring any kind of meaningful energy to this whole system,” he said.