On the surface of a cuboid { (x, y, z) | 0 ≤ x ≤ L, 0 ≤ y ≤ W, 0 ≤ z ≤ H } are two points with coordinates (x_1, y_1, z_1) and (x_2, y_2, z_2). There are many ways of passing on the surface of the boxes, and connecting the given points. Required to find the square of the length of the shortest such paths.
Input file contains (in order) the following 9 integers: L W H x_1 y_1 z_{1 }x_2 y_2 z_2
The numbers are separated by spaces and/or newlines. Each of the numbers L, W, H does not exceed 100.
Derive the output file a single integer - the squared length of the desired path.