A new city is being built. Seen from above the city is a plane, and that plane is cut into 109×109 cells of equal size. The top left cell is (1,1) and the bottom right cell is (109,109). Every cell carries a number that records the influence on that cell, and every number starts at 0.
The city will contain many public facilities, so before construction the planners estimated the influence each facility spreads around it. One estimate has this form.
After all estimates are applied, the influence of one cell is the square of the number written on it, and the influence of the city is the sum of the influence of all cells.
Suppose there are these two estimates.
Cells (1,1) and (2,1) then hold 1, cells (1,2), (1,3), (2,2), (2,3) hold 3, cells (3,2) and (3,3) hold 2, and every other cell holds 0. The influence of the city is 12×2+32×4+22×2=46.

Given N estimates, write a program that computes the influence of the city after all of them are applied.
The first line contains the number of estimates N (1≤N≤105).
Each of the next N lines contains a, b, c, d, p (1≤a≤c≤109, 1≤b≤d≤109, 1≤p≤100) separated by spaces. Each line is one estimate as described above.
Print the influence of the city after all estimates are applied. The answer can be very large, so print it modulo 1,000,000,007.