#include <bits/stdc++.h>
using namespace std;
struct Point {
  long long x, y;
  Point() {}
  Point(long long a, long long b) : x(a), y(b) {}
  Point operator-(Point b) { return Point(x - b.x, y - b.y); }
  bool operator<(const Point& b) const {
    return (x != b.x) ? x < b.x : y < b.y;
  }
};
inline long long cross(Point x, Point y) { return x.x * y.y - x.y * y.x; }
vector<Point> vt[1200000];
Point p[300005];
int top;
void build(vector<Point> a) {
  top = 0;
  sort(a.begin(), a.end());
  for (int i = 0; i < a.size(); i++) {
    while (top > 1 && cross(a[i] - p[top - 1], p[top] - p[top - 1]) <= 0) top--;
    p[++top] = a[i];
  }
}
void update(int l, int r, int o, int lx, int rx, Point p) {
  if (l >= lx && r <= rx)
    vt[o].push_back(p);
  else {
    int m = ((l + r) >> 1);
    if (m >= lx) update(l, m, o * 2, lx, rx, p);
    if (m < rx) update(m + 1, r, o * 2 + 1, lx, rx, p);
  }
}
long long ans[300005], q[300005];
bool in[300005];
inline long long getsum(Point x, long long q) { return x.x * q + x.y; }
long long solve(long long q) {
  int l = 1, r = top;
  while (r - l > 2) {
    int m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (getsum(p[m1], q) > getsum(p[m2], q))
      r = m2;
    else
      l = m1;
  }
  long long ans = -(long long)(2e18);
  for (int i = l; i <= r; i++) ans = max(ans, getsum(p[i], q));
  return ans;
}
void query(int l, int r, int o) {
  build(vt[o]);
  for (int i = l; i <= r; i++)
    if (in[i]) ans[i] = max(ans[i], solve(q[i]));
  if (l == r) return;
  int m = ((l + r) >> 1);
  query(l, m, o * 2);
  query(m + 1, r, o * 2 + 1);
}
Point ope[300005];
bool vis[300005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int kind;
    scanf("%d", &kind);
    if (kind == 1) {
      int x, y;
      scanf("%d%d", &x, &y);
      ope[i] = Point(x, y);
      vis[i] = 1;
    } else if (kind == 2) {
      int x;
      scanf("%d", &x);
      if (vis[x]) update(1, n, 1, x, i - 1, ope[x]);
      vis[x] = 0;
    } else {
      scanf("%lld", &q[i]);
      in[i] = 1;
    }
  }
  for (int i = 1; i <= n; i++)
    if (vis[i]) update(1, n, 1, i, n, ope[i]);
  for (int i = 1; i <= n; i++) ans[i] = -(long long)(2e18);
  query(1, n, 1);
  for (int i = 1; i <= n; i++)
    if (in[i]) {
      if (ans[i] == -(long long)(2e18))
        puts("EMPTY SET");
      else
        printf("%lld\n", ans[i]);
    }
  return 0;
}
