Four teams are taking part in a football tournament. During this tournament, each team must play one game against every other team. Some of the games have already been played and the results are known. Your task is to determine the possible outcomes of the tournament, assuming that the remaining games could have any result (each team can score any non-negative integer number of goals).
After each game, the winning team gets points and the losing team gets points. In case of a draw, both teams get point. The teams are ranked according to the sum of their points. If two teams have the same number of points, they are ranked by the difference between scored goals and conceded goals (the greater s - c, the better the rank). If the values of s - c are also the same, their places are determined by lot. In the end, each team gets a distinct rank from to .
The first line contains the number (0 \le n \le 6) of games already played. The next lines describe these games. Each game is described by integers , , , where and are the numbers of the teams, and , are the number of goals scored by team and team respectively (1 \le a < b \le 4; 0 \le c, d \le 10). It is guaranteed that no two teams have played more than one game against each other.
On the first line, output the number of different possible tournament outcomes. Two outcomes of the tournament are different if there is a team which is ranked differently in these outcomes. Each of the next lines should contain four integers: the numbers of the teams which get ranks , , , and respectively. The outcomes should be listed in lexicographical order.
Example 1