B. Bust Blasting
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Charlie the CNC miller is a cad with a capital 'C'. He is going to clone a valuable statue of a famous voxel-based video game character, and you are going to help him.

The voxel shape is defined by three photos Charlie took, which have been traced into the form of simple, axis-aligned (but potentially concave) polygons representing front ($$$xy$$$), side ($$$zy$$$), and top ($$$xz$$$) views of the statue respectively.

The meaning of "axis-aligned" here is that every edge of every polygon is parallel with one of the $$$X$$$/$$$Y$$$/$$$Z$$$ axes.

Any 3-dimensional point not contained by all three polygon projections will be blasted out of existence leaving only the true form, which may consist of multiple pieces or no pieces at all.

Illustration of a complex statue.

Calculate the volume of the final statue.

Input

The input consists of three lines of input, each giving one view as a two-dimensional, axis-aligned polygon in anti-clockwise order, with integer coordinates measured in centimetres.

  • First, the number of points, $$$n_i$$$ ($$$4 \le n \le 100$$$).
  • Thereafter, $$$n_i$$$ pairs of integers $$$u_{ij}$$$ and $$$v_{ij}$$$ for all $$$1 \le j \le n_i$$$ ($$$-10\,000 \le u,v \le 10\,000$$$).

It is guaranteed that for all adjacent vertices $$$a$$$ and $$$b$$$, $$$u_{ia} = u_{ib}$$$ or $$$v_{ia} = v_{ib}$$$. No three consecutive vertices are collinear.

Output

Output the integer total volume of the resulting shape(s) in cubic centimetres.

Example
Input
4 0 0 10 0 10 10 0 10
4 5 7 15 7 15 15 5 15
4 11 6 11 12 6 12 6 6
Output
72