Three people $A, B, C$ counted a pile of balls of four colors (see table).

|  | red | orange | yellow | green |
| :--- | :---: | :---: | :---: | :---: |
| A | 2 | 5 | 7 | 9 |
| B | 2 | 4 | 9 | 8 |
| C | 4 | 2 | 8 | 9 |

Each of them correctly distinguished two colors, but could confuse the other two: one confused red and orange, another - orange and yellow, and the third - yellow and green. The results of their counts are given in the table. How many balls of each color were there actually?
Only one of them could have made a mistake in counting the red balls, while the other two correctly counted the number of red balls. Therefore, there were 2 red balls. In the count of red balls, $C$ made a mistake, so he must have confused red with orange, while correctly counting the yellow and green balls. This gives us 8 yellow and 9 green balls. All the remaining balls are orange. The total number of balls was correctly counted by everyone as 23. Therefore, there were 4 orange balls.

## Answer

Red - 2, orange - 4, yellow - 8, green - 9.