#include <bits/stdc++.h>
const long long INF = 1LL << 61;
using namespace std;
int t[300005], r[300005], empty[300005];
long long ans[300005];
struct Point {
  long long x, y;
  bool operator<(const Point &B) const {
    return x < B.x || (x == B.x && y < B.y);
  }
  Point operator-(const Point &B) const { return (Point){x - B.x, y - B.y}; }
  Point operator+(const Point &B) const { return (Point){x + B.x, y + B.y}; }
  long long operator^(const Point &B) const { return x * B.y - y * B.x; }
  long long operator*(const Point &B) const { return x * B.x + y * B.y; }
} p[300005], S[300005];
vector<Point> tr[300005 << 2];
void insert(int l, int r, int L, int R, int o, int v) {
  if (l <= L && R <= r) {
    tr[o].push_back(p[v]);
    return;
  }
  int M = L + R >> 1;
  if (l <= M) insert(l, r, L, M, o << 1, v);
  if (r > M) insert(l, r, M + 1, R, o << 1 | 1, v);
}
void query(int x, int n) {
  int l = 1, r = n;
  while (r - l >= 3) {
    int m1 = l + (r - l) / 3;
    int m2 = l + (r - l) * 2 / 3;
    if (p[x] * S[m1] < p[x] * S[m2])
      l = m1;
    else
      r = m2;
  }
  for (int i = l; i <= r; i++) ans[x] = max(ans[x], p[x] * S[i]);
}
void solve(int l, int r, int o) {
  if (l < r) {
    int m = l + r >> 1;
    solve(l, m, o << 1);
    solve(m + 1, r, o << 1 | 1);
  }
  sort(tr[o].begin(), tr[o].end());
  int top = 0;
  for (int i = 0; i < tr[o].size(); i++) {
    while (top > 1 && ((S[top] - S[top - 1]) ^ (tr[o][i] - S[top])) >= 0) top--;
    S[++top] = tr[o][i];
  }
  for (int i = l; i <= r; i++)
    if (t[i] == 3 && !empty[i]) query(i, top);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1, cnt = 0, x; i <= n; i++) {
    scanf("%d", &t[i]);
    if (t[i] == 1)
      scanf("%lld %lld", &p[i].x, &p[i].y), r[i] = n, cnt++;
    else if (t[i] == 2)
      scanf("%d", &x), r[x] = i, cnt--;
    else
      scanf("%lld", &p[i].x), p[i].y = 1LL, empty[i] = (cnt == 0),
                              ans[i] = -INF;
  }
  for (int i = 1; i <= n; i++)
    if (t[i] == 1 && i + 1 <= r[i]) insert(i, r[i], 1, n, 1, i);
  solve(1, n, 1);
  for (int i = 1; i <= n; i++)
    if (t[i] == 3) {
      if (empty[i])
        puts("EMPTY SET");
      else
        printf("%lld\n", ans[i]);
    }
  return 0;
}
