Dusan and Cupko both lost their way in life before finding themselves behind bars in Serbia's largest prison.
Now the pair -- one a 49-year-old inmate and the other a shaggy mutt -- are hoping to leave together thanks to a programme that matches prisoners with stray dogs and prepares both for a second chance.
The social reintegration scheme, in which inmates spend two hours a day teaching the dogs basic commands, is a novel approach to incarceration in a region whose jails are better known for being among Europe's most overcrowded.
Working daily with Cupko touched something "primordial" in him, said inmate Dusan Steric, reaching down to ruffle the black fur of the dog whose name translates as "Shaggy" in Serbian.
"It has been the most beautiful dream, to work here and work with the dogs," he added, after a training session with eight other prisoners and dogs in a grassy patch on the grounds of the men's jail in Sremska Mitrovica.
Since the initiative was started two years ago, some 80 inmates have passed through 10-week training.
The goal is to get the dogs ready for adoption by the public, but also to reduce reoffending rates by preparing convicts for employment in places like animal shelters or zoos.
- Straining at the leash -
Serbia's prisons are in the top 10 most overcrowded in Europe, with an average of 109.2 inmates per 100 places available, according to a 2018 Council of Europe report.
In 2015, the Pan-European rights body also reported "inhuman and degrading treatment" in some jails.
The Sremska Mitrovica programme -- the only one of its kind in the Western Balkans -- initially began because the northwestern town was struggling to cope with a large stray dog population and asked the prison to build a dog shelter on its property.
With help from the Organization for Security and Co-operation in Europe, the prison decided to turn the situation into something symbiotic.
Now hundreds of dogs of all shapes, sizes and colours live at the kennels, yelping with delight as the prisoners’ approach to feed them, clean their cages or take them out for a training session.
- 'Change a man' -
The men and animals often become "so attached to each other that it is not rare for prisoners, or their families, to adopt the dog they worked with and take it home," said top trainer Pedrag Balanac, who teaches the prisoners.
That is Steric's plan for Cupko when he is released after a six-month sentence.
"I don't have the right conditions to take more
The prison's governor, Aleksandar Alimpic, said that he was initially sceptical about the idea.
But now, he said that he was "absolutely convinced that this is the best programme for re-socialisation in the world".
"This programme can change a man," he said, describing how staff have noticed a "huge development of empathy among prisoners as well as a significant reduction in aggression towards each other".
Currently, the opportunity is only open to inmates who have committed lesser offences.
But the prison is preparing to expand it to its higher-security zone, while there are also plans to implement it in juvenile prisons.
- 'We are the same' -
The dogs are moving up in the world too.
Many of them "were aggressive when they came to the shelter from the street, and now they have become real pets," said Alimpic, adding that up to 20 dogs can be adopted in a week.
Radomir Djakovic, a 30-year-old inmate, has already adopted two dogs from the shelter who are living with his wife and waiting for him to come home.
He wrote about the experience in a creative writing course offered by the prison.
"Dear friend, we are the same kind," he wrote. "You were brought in a cage and I was also confined."
The programme has also inspired a business idea.
"I want to have a hotel for dogs and take owners' dogs to care for them -- that is the dream," said Djakovic, as his yellow labrador mix sat patiently by his side.
"This is the only nice thing that happened to me in the prison," he added.