text: Doctors realised Maia Collingswood needed the transplant after her father Dan revealed he also had the procedure in 1997.
  Maia, from Barmouth, Gwynedd, had the transplant at London's Great Ormond Street Hospital in August after a three-month wait for a new heart.
  She has now been welcomed back to her school, Ysgol y Traeth.
  Maia, a year five pupil, fell ill at Easter while visiting her grandparents in Telford, Shropshire.
  "Maia was out of breath and could not move," explained her mother, Hannah Carter.
  "She was taken to the local hospital and then transferred to the Birmingham Children's Hospital where a heart problem was diagnosed."
  But Maia's father said when he questioned doctors and revealed he had undergone a heart transplant, the medical team realised her condition was serious.
  She was transferred to the London Children's Hospital, where surgeons confirmed she also needed a heart transplant.
  Her condition continued to deteriorate over the next three months, until she finally received the donor heart she needed on 15 August.
  It was three months of desperate worry for her parents, who are are separated, but remain friends. The local community rallied around to ensure they could spend as much time as possible with their daughter in London.
  "Dan's family, my family, the school, friends and indeed the whole community here in Barmouth and in Telford have been magnificent and supported us throughout the summer after Maia was taken ill," said Mrs Carter, who works for the Gwynedd home care team.
  Mr Collingswood, who works at a private care establishment near Dolgellau, added: "I am with the local lifeboat here in Barmouth and the RNLI helped us out financially when we had to visit Maia in hospital in London.
  "The community has been great, there were collection tins everywhere for Maia and it helped us out. We could not have managed without the support of the community."
  On Tuesday, Maia was greeted by pupils and the head teacher as she returned to class, seven weeks ahead of schedule.
  "Maia would have liked to have gone back to school last week but we had to travel to Great Ormond Street for check-ups," said her mother.
  "She asked if she could go back to school after returning home from London and the expert medical team said that it was OK. Maia was delighted."
  The long wait for the transplant meant Hannah's mother had to give up her flat in Barmouth to be with her daughter, but she has now moved into a new home with Maia after being rehoused by housing organisation Cartrefi Cymunedol Gwynedd.
  Mrs Carter added: "I started back to work this week, Maia has started school, we have a new flat, it is all coming together.
  "It has been a long and traumatic summer and without the support of family, friends and the community and the medical team, I don't know how I got through it."
  Maia herself said she was delighted to be back in the classroom, and revealed how she had coped with her long stay in hospital.
  "I used to talk to my school friends on Skype when I was in hospital in London and the headmaster visited me a couple of times."
  She also had a number of special visitors while on the hospital wards.
  "When I was in hospital I met the singer Adele, racing driver Lewis Hamilton, Alexandra Burke from the X Factor and two American astronauts, " she said.
target: A nine-year-old girl has undergone a heart transplant, 14 years after her father had the same operation.