4. $214 A$, $B$, $C$ three people are playing a game: On three cards, write down the integers $p$, $q$, $r$ ($0<p<q<r$). Mix these three cards and distribute them to $A$, $B$, $C$, each getting one. Then, give each person marbles according to the number on their card, and then collect the cards, leaving the marbles with the individuals. This process is repeated for more than two rounds (each round includes mixing the cards, distributing the cards, giving marbles, and collecting the cards). After the final round, $A$, $B$, $C$ have a total of 20, 10, 9 marbles respectively. It is known that $B$ received $r$ marbles in the last round. Who received $q$ marbles in the first round?
[Solution] Let the game have proceeded for $n$ rounds, then
$$n(p+q+r)=20+10+9=39$$

Since $00$ is contradictory. Therefore, the number of marbles $C$ obtained in the last round must be $p$, and the number of marbles $A$ obtained in the last round is $q$, so we have
$$2 r+q=20,2 p+r=10,2 q+p=9 .$$
Solving these equations, we get
$$p=1, q=4, r=8 \text {. }$$