import sys from operator import itemgetter readline = sys.stdin.readline N = int(readline()) Box = [] LL = [] for i in range(N): a, b, c = map(int, readline().split()) a, b, c = sorted([a, b, c]) LL.extend([c, c, b]) Box.append((i, 0, a, b, c)) Box.append((i, 1, b, a, c)) Box.append((i, 2, c, a, b)) LL.append(0) Box.sort(key = lambda x: (x[3], x[4])) INF = 10**9+7 dp = [[-INF]*(3*N+1) for _ in range(1<