#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e18;
struct cht {
  vector<pair<int, int> > hull;
  int cur = 0;
  cht() { hull.clear(); }
  bool useless(const pair<int, int> left, const pair<int, int> middle,
               const pair<int, int> right) {
    return (middle.second - left.second) * 1ll * (middle.first - right.first) >=
           (1ll * (right.second - middle.second) * (left.first - middle.first));
  }
  void insert(int a, int b) {
    if (hull.empty()) {
      hull.push_back(make_pair(a, b));
    } else {
      if (hull.back().first == a) {
        if (hull.back().second >= b) {
          return;
        } else {
          hull.pop_back();
        }
      }
      while (hull.size() >= 2 && useless(hull[(int)hull.size() - 2],
                                         hull.back(), make_pair(a, b))) {
        hull.pop_back();
      }
      hull.push_back(make_pair(a, b));
    }
  }
  double meet(const pair<int, int> x, const pair<int, int> y) {
    return 1.0 * (y.second - x.second) / (x.first - y.first);
  }
  long long query(int x) {
    if (hull.empty()) return -inf;
    while ((cur + 1) < hull.size() && meet(hull[cur], hull[cur + 1]) < x) {
      ++cur;
    }
    return 1ll * hull[cur].first * x + hull[cur].second;
  }
};
const int N = 3e5 + 5;
const int SN = 1 << 20;
int n;
int type[N];
int a[N], b[N], x[N];
cht segtree[SN];
void update(int l, int r, int node, int ql, int qr, int a, int b) {
  if (l > qr || r < ql) {
    return;
  }
  if (l >= ql && r <= qr) {
    segtree[node].insert(a, b);
    return;
  }
  int mid = (l + r) / 2;
  update(l, mid, node + node, ql, qr, a, b);
  update(mid + 1, r, node + node + 1, ql, qr, a, b);
}
long long query(int l, int r, int node, int idx, int val) {
  long long ret = segtree[node].query(val);
  if (l < r) {
    int mid = (l + r) / 2;
    if (idx <= mid) {
      ret = max(ret, query(l, mid, node + node, idx, val));
    } else {
      ret = max(ret, query(mid + 1, r, node + node + 1, idx, val));
    }
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &type[i]);
    if (type[i] == 1) {
      scanf("%d %d", &a[i], &b[i]);
      x[i] = n;
    } else if (type[i] == 2) {
      scanf("%d", &x[i]);
      x[x[i]] = i - 1;
    } else {
      scanf("%d", &x[i]);
    }
  }
  vector<pair<int, int> > vv;
  vv.clear();
  for (int i = 1; i <= n; i++) {
    if (type[i] == 1) {
      vv.push_back(make_pair(a[i], i));
    }
  }
  sort(vv.begin(), vv.end());
  for (auto it : vv) {
    update(1, n, 1, it.second, x[it.second], it.first, b[it.second]);
  }
  vv.clear();
  for (int i = 1; i <= n; i++) {
    if (type[i] == 3) {
      vv.push_back(make_pair(x[i], i));
    }
  }
  sort(vv.begin(), vv.end());
  vector<pair<int, long long> > ans;
  ans.clear();
  for (auto it : vv) {
    ans.push_back(make_pair(it.second, query(1, n, 1, it.second, it.first)));
  }
  sort(ans.begin(), ans.end());
  for (auto it : ans) {
    if (it.second == -inf) {
      printf("EMPTY SET\n");
    } else {
      printf("%I64d\n", it.second);
    }
  }
  return 0;
}
