import sys # sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() # dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = 10**16 md = 998244353 # md = 10**9+7 # 内部で1-indexedに変えるので入力は0-indexedでよい # jは内部で座圧する # nはiの最大値+1(リストの長さ) class BitMax2D: class Node: def __init__(self): self.st = set() def comp(self): self.enc = {a: i for i, a in enumerate(sorted(self.st))} self.bit = BitMax(len(self.enc)) def update(self, j, val): j = self.enc[j] self.bit.update(j, val) def max(self, j): j = self.enc[j] return self.bit.max(j) def __init__(self, n): self.inf = 10**16 self.n = n self.table = [self.Node() for _ in range(n+1)] # インデックスの先読み def pre_read(self, i, j): i = k = i+1 while i <= self.n: self.table[i].st.add(j) i += i & -i while k > 0: self.table[k].st.add(j) k -= k & -k # 先読み終了後に準備 def prep(self): for i in range(self.n): self.table[i+1].comp() def update(self, i, j, val): i += 1 while i <= self.n: self.table[i].update(j, val) i += i & -i def max(self, i, j): i += 1 res = -self.inf while i > 0: cur = self.table[i].max(j) if cur > res: res = cur i -= i & -i return res class BitMax: def __init__(self, n): self.inf = 10**16 self.n = n self.table = [-self.inf]*(self.n+1) def update(self, i, x): i += 1 while i <= self.n: if x > self.table[i]: self.table[i] = x i += i & -i def max(self, i): i += 1 res = -self.inf while i > 0: if self.table[i] > res: res = self.table[i] i -= i & -i return res def space(a, b, c, d, e, f): a, b, c, d = a-e, b-f, c-e, d-f return abs(a*d-b*c) n, q = LI() bit = BitMax2D(n+q) task = [] for _ in range(n): a, b, c, d, e, f = LI() l = min(a, c, e) r = max(a, c, e) s = space(a, b, c, d, e, f) task.append((l, 0, r, s, 0)) bit.pre_read(0, r) ans = [] for i in range(q): tx = LI() if tx[0] == 1: _, a, b, c, d, e, f = tx l = min(a, c, e) r = max(a, c, e) s = space(a, b, c, d, e, f) task.append((l, 0, r, s, i+1)) else: _, l, r = tx task.append((l, 1, r, i+1)) bit.pre_read(i+1, r) bit.prep() task.sort(key=lambda x: (-x[0], x[1])) for tt in task: if len(tt) == 5: l, _, r, s, i = tt bit.update(i, r, s) else: l, _, r, i = tt mx = bit.max(i, r) if mx == -inf: mx = -1 ans.append((i, mx)) ans.sort() for i, s in ans: print(s)