import sys input = sys.stdin.readline from bisect import * a = int(input()) Q = int(input()) inf = 10 ** 18 D = [(-inf, -inf, -inf+1)] C, P = [-inf], [(-inf, -inf+1)] for _ in range(Q): q = list(map(int, input().split())) if q[0] == 1: s, t = q[1:] while D: x, s1, t1 = D[-1] if s1 + t1 + s + t == 0: D.pop() C.pop() P.pop() continue else: y = (- s * t + s1 * t1)/(s1 + t1 - s - t) if y <= x: D.pop() C.pop() P.pop() continue else: D.append((y, s, t)) C.append(y) P.append((s, t)) break else: # print(C, P) x = q[1] ind = bisect_right(C, x) s, t = P[ind - 1] ans = -a * (x - s) * (x - t) if ind <= len(P) - 1: s, t = P[ind] ans = max(ans, -a * (x - s) * (x - t)) print(max(0, ans))