Ngoc and Minh devised a creative way to eat candy that comes in three different colours: red, green, and blue.
They begin by arranging some coloured candies into a line. Then, the candy at the front of Ngoc's line is compared to the candy at the front of Minh's line. If both candies are the same colour, then Ngoc and Minh each eat the candy at the front of their own line. If the candies are different colours, then the person with the winning candy eats the losing candy, and the winning candy stays at the front of its line.
- Red candy wins against green candy
- Green candy wins against blue candy
- Blue candy wins against red candy
This process of comparing and eating candy repeats until there is at least one empty line of candy. When that happens, if one person still has candy left in their line, then that person eats all of their leftover candy.
Your job is to determine how much candy each person eats.