Today is the Atomic Energy Highschool Futsal Championship’s final. Alice's class is playing against Bob's class. Each team consists of five players and a goalkeeper. The game ends 1 - 1 during the 90 minutes of the official time. Teachers want to send the students to the class as soon as possible so they do not allow teams to play in the extra times and the winner will be identified by the penalty kicks. The rules for the penalty kicks are as follows:
Goalkeepers are not allowed to play in the penalty kicks. Mr.Asadi who is the organizer of the championship is going to give a completely random permutation of both teams, that is, between 5! * 5! possible choices of permutation of players of Alice's team and Bob's team, one of them is chosen. He has also given Alice a permutation p and has given Bob a permutation q.
At first, Alice's team will take their shots, when the ith player from Alice's team is taking his shot the pthi player from Bob's team will be goalkeeping. Note that ith player means the ith player in the permutation, not the ith player is given in the input. Alice and Bob have given three integers li, mi, and ri for all of the ten players in the field(not including the real goalkeepers). These numbers are showing the percentage that each player will dive to left, middle, or right as a goalkeeper or shoot to any of these directions as a player.
Each team will gain a score from a penalty if and only if the shoot of their player does not be in the same direction as the opposite goalkeeper's dive. After the match (When all of the players have shot exactly once) if both teams score the same number of goals, Mr.Asadi will announce both teams as the champion otherwise the team with more scores will be the champion. Bob is studying probability at high school, so he wanna know the probability that his team is the only champion of the school.
Input format
Output format
Let pq (where gcd(p,q)=1) be the probability of being Bob's team as the only champion of the school. Print a single integer denoting p×q−1mod 1000000007.
Sample input
1 2 3 4 5
1 2 3 4 5
0 0 100
0 0 100
0 0 100
0 0 100
0 0 100
0 50 50
0 50 50
0 50 50
0 50 50
0 50 50
Sample output
517578129
Explanations
For example, one of the possible arrangement is [2, 1, 3, 5, 4] (Alice's team) and [5, 4, 3, 1, 2] (Bob's team). So, the following penalty kicks can occur:
All the shots will be goal and the only available result will be 5 - 5 so none of the teams can win the championship alone and the answere is 0.