Recently, RUN was asked to connect cables between all pairs of the N areas of KAIST.
We treat the areas as regions on the 2-dimensional plane. The boundary of each region is a 4-sided polygon with 2 edges parallel to the x-axis, and 2 edges parallel to the y-axis. In other words, each region has a rectangular boundary with (x_1i,y_1i) as a lower left corner and (x_2i,y_2i) as a upper right corner. The regions may overlap.
The cables must be constructed along the x-axis or the y-axis, due to safety issues. So the cost of constructing a cable from (x_1,y_1) to (x_2,y_2) is x_1−x_2+y_1−y_2 won.
A cable connecting two areas A and B should connect two points, one from each region.
Find the minimum sum of the cost for connecting (2N) cables between all pairs of the areas.
Note that the cables must be constructed for all (2N) pairs of areas. This means, for example, even if two endpoints of a cable belong to more than one pair of areas, we do not consider it as connecting all such pairs.
Since the answer can be large, output it modulo 998,244,353. It can be proved that the answer is always a non-negative integer.
The first line contains one integer, N.
The i-th of the following N lines contain space-separated four integers x_1i, y_1i, x_2i, and y_2i — indicating the positions of the lower left and the upper right corners of the region representing the i-th area.
Output a single integer — the minimum cost to construct all cables in the unit of won, modulo 998,244,353. 998,244,353=119×223+1 is a prime number.