Before the third group was given to the first two people, there were 25+2=27 people in the third group and 25-2=23 people in the first group;
Before the second group gave five people to the third group, the third group had 27-5=22 people, and the second group had 25+5=30 people.
Before the first group was given to the second group of eight people, the number of people in the second group was 30-8=22, and the number of people in the first group was 23+8 = 365,438+0.
So the first 3 1 person, the second 22 people, the third 22 people.