Please answer the following question: Given the following passage  "At the beginning of a match, an official tosses a coin and allows the captain of the visiting team call heads or tails. The captain of the team winning the coin toss is given the option of having first choice, or of deferring first choice to the other captain. The captain making first choice may either choose a) to kick off or receive the kick and the beginning of the half, or b) which direction of the field to play in. The remaining choice is given to the opposing captain. Before the resumption of play in the second half, the captain that did not have first choice in the first half is given first choice. Teams usually choose to defer, so it is typical for the team that wins the coin toss to kick to begin the first half and receive to begin the second.",  answer the following question. Note that the answer is present within the text.  Question: When is the coin toss done?
Answer:
beginning of a match