There are two possible interpretations of your question. Nij's answer refers to repeated offences by different players; I will deal with the simultaneous offending interpretation.
There is no answer to this in the Laws of the Game. The exact wording of the caution offence described in Law 12 - Fouls and Misconduct, Section 3 - Disciplinary Action (as you are probably already aware) is:
- failing to respect the required distance when play is restarted with a corner kick, free kick or throw-in
By the letter of the law, if a three-player wall breaks before a free kick is taken, all should be cautioned (if advantage cannot be played). Of course, this is not what happens in practice.
- If the ball strikes one of the offending players, normally that player will be cautioned.
- If the ball does not strike any of offending players, the referee will do their best to find an advantage and warn the players concerned at the next stoppage. If advantage cannot be played, normally the most obvious failure to respect the distance will get a caution.
- If all players move a similar amount towards the ball, the referee will simply pick a player (most likely one who is not already on a caution) and caution them.
It is extremely rare that a properly set and supervised wall will have one player break, let alone multiple players break. The above suggestions are based on what I've seen other referees do - I've never had it happen to me in over 10 years of refereeing yet!