IT is a gruelling worldwide treasure hunt that has taken its participants to some of the most stunning locations on the planet.
Solving mysteries locked by centuries old codes, the ten contestants in Channel 4's newest game show The Search have delved into Egyptian pyramids, French castle vaults and even passed the ancient ruins of the Incas and the Mayans.
But tonight, in the show's finale, the quest for the 50,000 grand prize is set to be solved in a rather more humble location.
For the chest of riches that the team has been searching for over the past month or so will be discovered in Craigmillar.
Producers for the show - which is presented by Jamie Theakston - had been scouring the UK for a suitable place to end the series and decided to use the story of Mary Queen of Scots to film the final episode in Edinburgh.
The contestants in the finale will be seen solving clues in Edinburgh Castle and breaking codes used by the historic monarch to locate the buried treasure, which programme bosses decided to hide in the shadow of Craigmillar Castle.
Producer Lucas Green said: "The show has already seen the contestants travel to locations around the world, but we really wanted to bring it back to Britain.
"The ethos of the programme has been about code-breaking and mysteries, so the story of Mary Queen of Scots really fitted in with that.
"She used to regularly write codes during her life and they play a big part in Edinburgh's history. One of the last plots ever hatched during her reign took place at Craigmillar Castle, so it was an ideal location for us.
"We filmed at Edinburgh Castle and then found a very dramatic spot in Craigmillar to bury the chest."
The show has been inspired by the popularity of code-breaking mysteries such as the Da Vinci Code and also includes excerpts detailing the history of each location the team visits.
For the Edinburgh episode, the programme-makers also had to work together with the castles' operators, Historic Scotland.
Sarah Jones, assistant filming and events manager at Historic Scotland, said: 'The Search producers were looking for locations with not only strong associations with Mary Queen of Scots, but enough magnificence and presence to inspire the contestants to solve the final clues and discover the treasure.
"Filming began at Edinburgh Castle, with clues hidden within the royal apartments, where Mary, Queen of Scots gave birth to James VI of Scotland and I of England.
"Contestants also stumbled upon our dungeons, finding themselves trapped and caught in a game where only logic could save them."
Speaking about the filming in Craigmillar, Chris Tabraham, principal historian at Historic Scotland added: "Craigmillar Castle is a hidden treasure itself and so a fitting place to end this global quest.
"Beyond its great historical significance, the castle is simply magnificent. It is one of the best preserved medieval castles in Britain.
"Working with the Channel 4 team was a pleasure, and I hope we succeeded in our endeavours to bring both castles alive for the viewers, perhaps inspiring them to take a trip themselves to see Edinburgh's historical treasures."
The Search will be shown at 5.20pm on Channel 4 tonight.