In a football league, whenever a player is transferred from a team $X$ with $x$ players to a team $Y$ with $y$ players, the federation is paid $y-x$ billions liras by $Y$ if $y \geq x$, while the federation pays $x-y$ billions liras to $X$ if $x > y$. A player is allowed to change as many teams as he wishes during a season. Suppose that a season started with $18$ teams of $20$ players each. At the end of the season, $12$ of the teams turn out to have again $20$ players, while the remaining $6$ teams end up with $16,16, 21, 22, 22, 23$ players, respectively. What is the maximal amount the federation may have won during the season?
1. **Initial Setup:**
   - There are 18 teams, each starting with 20 players.
   - Total initial number of players: \( 18 \times 20 = 360 \).

2. **Final Distribution:**
   - 12 teams have 20 players each.
   - Remaining 6 teams have 16, 16, 21, 22, 22, and 23 players.

3. **Total Number of Players at the End:**
   - Total players in 12 teams: \( 12 \times 20 = 240 \).
   - Total players in the remaining 6 teams: \( 16 + 16 + 21 + 22 + 22 + 23 = 120 \).
   - Total players at the end: \( 240 + 120 = 360 \).

4. **Calculation of Payments:**
   - For each transfer, we need to calculate the payment based on the difference in the number of players before and after the transfer.

5. **Teams with 16 Players:**
   - These teams lost \( 20 - 16 = 4 \) players each.
   - Federation pays \( 4 \) billion liras to each of these teams.
   - Total payment for these two teams: \( 2 \times 4 = 8 \) billion liras.

6. **Teams with 21 Players:**
   - This team gained \( 21 - 20 = 1 \) player.
   - Federation is paid \( 1 \) billion liras by this team.

7. **Teams with 22 Players:**
   - Each of these teams gained \( 22 - 20 = 2 \) players.
   - Federation is paid \( 2 \) billion liras by each of these teams.
   - Total payment from these two teams: \( 2 \times 2 = 4 \) billion liras.

8. **Team with 23 Players:**
   - This team gained \( 23 - 20 = 3 \) players.
   - Federation is paid \( 3 \) billion liras by this team.

9. **Net Gain Calculation:**
   - Total amount paid by the federation: \( 8 \) billion liras.
   - Total amount received by the federation: \( 1 + 4 + 3 = 8 \) billion liras.
   - Net gain for the federation: \( 8 - 8 = 0 \) billion liras.

The final answer is \(\boxed{0}\) billion liras.