It was Mohamed Khaleuf's third attempt to cross the Greek-Macedonian border. Hiding in a freight train, he told Reuters photographer Alexandros Avramidis that he was not planning on giving up.

"I promised myself I would try five times. If I'm not successful, I will try to cross from somewhere else," Khaleuf told Avramidis, who has been photographing Khaleuf and his friends, as they try to cross the border into Macedonia and eventually, central Europe.

Freight trains on the Greek-Macedonian border
Habib, 22, from Algeria sits in an abandoned railway wagon used as a shelter Alexandros Avramidis/Reuters

Still in his early twenties, Khaleuf is among dozens of people, mostly young Moroccans, Tunisians and Algerians, who arrived in Greece in the last year, and have since found shelter in old rusting carriages around a station in the outskirts of Greece's northern city of Thessaloniki. From there, they monitor freight trains heading to central Europe. Whenever trains stop in the station, they try to sneak into the compartments or jump in between wagons.

If they're lucky, they make it across unnoticed. Some said they plan to get off before the border and continue on foot. Often, they are arrested by Macedonian guards and sent back to Greece. No one can say how many have made it. A Greek government spokesman was not immediately available for comment.

In the abandoned trains where Khaleuf and others live, conditions are grim. There is no electricity or running water, and for food, they must queue up at a nearby camp, a former toilet paper factory. Yet despite the dire conditions, many choose the carriages over the camps as they can keep an eye on passing trains. People come and go, leaving piles of rubbish behind. Some carriages burned down in accidents when people tried to warm up in freezing winter temperatures.

"Here we live like animals," said Habib, a 22-year-old Algerian who spoke to Avramidis. Habib crossed from Turkey to the island of Rhodes and then hid under a truck on a ferry to Athens. Habib had attempted to leave Thessaloniki with a friend days earlier. They had leapt onto a train with their rucksacks, but without documents, the pair were arrested in Macedonia and were sent back to Greece.

Freight trains on the Greek-Macedonian border
Rubbish is seen between abandoned railway wagons that are used as shelters Alexandros Avramidis/Reuters

More than a million people arrived in Europe in 2015, landing in Greece from Turkey and then streaming through the Balkans, heading north to Germany or Austria. The route was closed in March 2016, following an agreement between the EU and Turkey. This left around 60,000 people stranded in camps – both makeshift and formal across Greece.