#include <bits/stdc++.h>
using namespace std;
int const inf = 1000 * 1000 * 1000;
long long const inf64 = 1ll * inf * inf;
template <class T>
struct ConvexHullTrick {
  size_t sz;
  vector<pair<T, T> > Lines, st;
  ConvexHullTrick() { sz = 0; }
  ConvexHullTrick(vector<pair<T, T> > _lines) : Lines(_lines) {
    sort((Lines).begin(), (Lines).end());
    pair<T, T> l1, l2, L;
    for (size_t i = 0; i < Lines.size(); i++) {
      L = Lines[i];
      while (!st.empty() && st.back().first == L.first) st.pop_back();
      while ((int)st.size() > 1) {
        l1 = st[(int)st.size() - 2];
        l2 = st[(int)st.size() - 1];
        if (1ll * (L.first - l2.first) * (l1.second - l2.second) <
            1ll * (l2.first - l1.first) * (l2.second - L.second))
          break;
        st.pop_back();
      }
      st.push_back(L);
    }
    sz = st.size();
  }
  bool check(size_t i, T x) const {
    pair<T, T> l1, l2;
    l1 = st[i - 1];
    l2 = st[i];
    return (l1.second - l2.second) <= 1ll * (l2.first - l1.first) * x;
  }
  T get(T x) const {
    if (sz == 1 || !check(1, x)) return st[0].first * x + st[0].second;
    size_t bl, br, bm;
    bl = 1;
    br = sz - 1;
    while (br - bl > 1) {
      bm = (bl + br) >> 1;
      if (check(bm, x))
        bl = bm;
      else
        br = bm - 1;
    }
    return max(st[bl].first * x + st[bl].second,
               st[br].first * x + st[br].second);
  }
};
long long const MIN_VALUE = -inf64 - inf - 1;
int n;
vector<char> del;
vector<pair<int, int> > Lines;
vector<int> type, que;
vector<vector<pair<long long, long long> > > t_lines;
vector<ConvexHullTrick<long long> > t_hull;
void add(int v, int tl, int tr, int l, int r, pair<long long, long long> line) {
  if (l <= tl && tr <= r) {
    t_lines[v].push_back(line);
  } else {
    int tm = (tl + tr) >> 1;
    if (l <= tm) add(v * 2 + 1, tl, tm, l, r, line);
    if (r > tm) add(v * 2 + 2, tm + 1, tr, l, r, line);
  }
}
long long get(int v, int tl, int tr, int pos, long long x) {
  long long res = MIN_VALUE;
  if (t_hull[v].sz > 0) res = max(res, t_hull[v].get(x));
  if (tl < tr) {
    int tm = (tl + tr) >> 1;
    if (pos <= tm)
      res = max(res, get(v * 2 + 1, tl, tm, pos, x));
    else
      res = max(res, get(v * 2 + 2, tm + 1, tr, pos, x));
  }
  return res;
}
bool solve() {
  scanf("%d", &n);
  del.resize(n);
  Lines.resize(n);
  que.resize(n);
  type.resize(n);
  t_lines.resize(4 * n);
  t_hull.resize(4 * n);
  for (int x, i = 0; i < n; i++) {
    scanf("%d", &type[i]);
    if (type[i] == 1) {
      scanf("%d %d", &Lines[i].first, &Lines[i].second);
    } else if (type[i] == 2) {
      scanf("%d", &x);
      x--;
      del[x] = 1;
      add(0, 0, n - 1, x, i, Lines[x]);
    } else {
      scanf("%d", &que[i]);
    }
  }
  for (int i = 0; i < n; i++) {
    if (type[i] == 1 && !del[i]) {
      add(0, 0, n - 1, i, n - 1, Lines[i]);
    }
  }
  for (int i = 0; i < 4 * n; i++) {
    if (t_lines[i].empty()) continue;
    t_hull[i] = ConvexHullTrick<long long>(t_lines[i]);
  }
  for (int i = 0; i < n; i++) {
    if (type[i] == 3) {
      long long x = get(0, 0, n - 1, i, que[i]);
      if (x == MIN_VALUE)
        printf("EMPTY SET\n");
      else
        printf("%I64d\n", x);
    }
  }
  return true;
}
int main() {
  solve();
  return 0;
}
