import itertools
from itertools import combinations
class Point:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def readints():
return list(map(int, input().split()))
def cross(p1, p2):
return p1.x * p2.y - p1.y * p2.x
def area(points):
if len(points) < 3:
return 0.0
n = len(points)
res = 0.0
for i in range(n):
j = (i + 1) % n
res += points[i].x * points[j].y - points[j].x * points[i].y
return abs(res) / 2.0
def convex_hull(points):
points = sorted(points, key=lambda p: (p.x, p.y))
lower = []
for p in points:
while len(lower) >= 2 and (cross(Point(lower[-1].x - lower[-2].x, lower[-1].y - lower[-2].y, 0), Point(p.x - lower[-1].x, p.y - lower[-1].y, 0)) <= 0):
lower.pop()
lower.append(p)
upper = []
for p in reversed(points):
while len(upper) >= 2 and (cross(Point(upper[-1].x - upper[-2].x, upper[-1].y - upper[-2].y, 0), Point(p.x - upper[-1].x, p.y - upper[-1].y, 0)) <= 0):
upper.pop()
upper.append(p)
return lower[:-1] + upper[:-1]
def main():
m = list(map(int, input().split()))
groups = []
for cnt in m:
group = []
for _ in range(cnt):
x, y, z = map(int, input().split())
group.append(Point(x, y, z))
groups.append(group)
max_area = 0.0
for quad in itertools.product(*groups):
points_xy = [Point(p.x, p.y, 0) for p in quad]
hull = convex_hull(points_xy)
if len(hull) < 3:
continue
current_area = area(hull)
max_area = max(max_area, current_area)
print(int(max_area))
if __name__ == "__main__":
main()