#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0, b = getchar(), c = 1;
  while (!isdigit(b)) c = b == '-' ? -1 : 1, b = getchar();
  while (isdigit(b)) a = a * 10 + b - '0', b = getchar();
  return a * c;
}
const int M = 3e5 + 5;
struct node {
  long long x, y, id;
  bool operator<(const node &A) const {
    if (x != A.x) return x < A.x;
    return y < A.y;
  }
} s[M];
long long n, a[M], q[M], ki[M], st[M], ed[M], ans[M];
long long gg(long long k, long long ab) {
  int l = 1, r = ab;
  while (l < r) {
    int mid = l + r >> 1;
    if (k * s[q[mid]].x + s[q[mid]].y > k * s[q[mid + 1]].x + s[q[mid + 1]].y)
      r = mid;
    else
      l = mid + 1;
  }
  if (ab) return k * s[q[l]].x + s[q[l]].y;
  return -3e18;
}
void query(long long l, long long r, long long ab) {
  for (int i = l; i <= r; i++)
    if (a[s[i].id] == 3) ans[s[i].id] = max(ans[s[i].id], gg(ki[s[i].id], ab));
}
void gao(long long l, long long r) {
  if (l == r) return;
  int mid = l + r >> 1;
  gao(l, mid), gao(mid + 1, r);
  sort(s + l, s + mid + 1);
  int ab = 0;
  for (int i = l; i <= mid; i++) {
    if (a[s[i].id] != 1 or ed[s[i].id] <= r) continue;
    while (ab > 1 and (s[i].y - s[q[ab]].y) * (s[i].x - s[q[ab - 1]].x) >=
                          (s[i].x - s[q[ab]].x) * (s[i].y - s[q[ab - 1]].y))
      ab--;
    q[++ab] = i;
  }
  query(mid + 1, r, ab);
  sort(s + mid + 1, s + r + 1);
  ab = 0;
  for (int i = mid + 1; i <= r; i++) {
    if (a[s[i].id] != 2 or st[s[i].id] >= l) continue;
    while (ab > 1 and (s[i].y - s[q[ab]].y) * (s[i].x - s[q[ab - 1]].x) >=
                          (s[i].x - s[q[ab]].x) * (s[i].y - s[q[ab - 1]].y))
      ab--;
    q[++ab] = i;
  }
  query(l, mid, ab);
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) {
    ans[i] = -3e18, a[i] = read(), s[i].id = i;
    if (a[i] == 1) {
      s[i].x = read(), s[i].y = read();
      ed[i] = n + 1;
    } else if (a[i] == 3)
      ki[i] = read();
    else {
      int x = read();
      s[i].x = s[x].x;
      s[i].y = s[x].y;
      ed[x] = i, st[i] = x;
    }
  }
  gao(1, n);
  for (int i = 1; i <= n; i++)
    if (a[i] == 3) {
      if (ans[i] == -3e18)
        puts("EMPTY SET");
      else
        printf("%lld\n", ans[i]);
    }
  return 0;
}
