The young soccer teammates and their coach who were rescued after being trapped in a cave in northern Thailand had their heads shaved in a ceremony on Tuesday as they prepared to be ordained as Buddhist novices and monks.

Eleven of the 12 boys and their coach prayed to ancient relics and offered drinks and desserts in gilded bowls to spirits at a Buddhist temple. The 12th team member who was trapped in the cave did not take part because he isn’t Buddhist.

The boys, whose ages range from 11 to 16, will be ordained to become Buddhist novices in a ceremony on Wednesday, while the 25-year-old coach will be ordained as a monk, said Parchon Pratsakul, the governor of Chiang Rai province.

Wednesday’s ordainment ceremony will take place at another temple on a Chiang Rai mountaintop before the group returns to live for more than a week at the Wat Pha That Doi Wao temple near Thailand’s northern border with Myanmar. That temple is close to the group’s homes, making it easier for friends and relatives to visit.

“This temple will be where they will reside after the ordination and I hope they will find peace, strength and wisdom from practicing Buddha’s teaching,” said acting abbot Phra Khru Prayutjetiyanukarn.

Male Buddhists in Thailand are traditionally expected to enter the monkhood, often as novices, at some point in their lives to show gratitude, often towards their parents for raising them. It’s believed that once a person is ordained they gain merit that is also extended to their parents.

“Ordinations are supposed to give us peace of mind,” said Sangiemjit Wongsukchan, the mother of Ekarat Wongsukchan, 14, one of the boys who was trapped in the cave. “We can only do this for nine days because then he will have to go back to study and prepare for exams. Back to his normal life.”

Praphun Khomjoi, chief of Chiang Rai’s Buddhism office, said the 12 to be ordained will dedicate their merit-generating act of entering the monkhood to volunteer diver and former Thai Navy Seal, Samarn Gunan, who died during a mission to supply the cave with oxygen tanks essential to helping the boys escape.

The 12 boys and their coach were released from hospital last Wednesday, more than a week after they were rescued from the flooded cave. They became trapped on June 23 and were finally found by two British divers on July 2. They were taken out of the cave in a daring rescue mission that ended on July 10.

Parchon said on Sunday that the boys’ mental and physical conditions were steadily improving with only minor health complications. He said one boy, who initially reported that he had rashes, did not appear to have any new ones.

Dozens of local residents joined in Tuesday morning’s temple ceremonies to show support for the group, whose rescue captivated Thais as well as people around the world. By the afternoon, around 200 people had gathered at the temple as monks shaved the heads of the boys and their coach in preparation for the ordainment.

“I was so happy to see them alive and I thought it would be good to attend the ceremony to show them our support,” said Apinya Winthachai, a local Buddhist nun.