#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read(T& x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x = f ? -x : x;
}
const int N = 3e5 + 10;
const int DEL = 1e9 + 7;
const long long INF = 2000000000000000000LL;
struct Line {
  int k, b;
  Line() {}
  Line(int k, int b) : k(k), b(b) {}
  bool operator<(const Line& rhs) const {
    return k ^ rhs.k ? k < rhs.k : b < rhs.b;
  }
  long long f(int x) { return (long long)k * x + b; }
};
vector<Line> T[N << 2];
pair<int, int> seg[N], op[N];
int n, t, c, i, cnt, S[N];
long long res;
void add(int root, int l, int r, int L, int R, Line a) {
  if (L <= l && r <= R) {
    T[root].push_back(a);
    return;
  }
  int mid = l + ((r - l) >> 1);
  if (L <= mid) add(root << 1, l, mid, L, R, a);
  if (mid < R) add(root << 1 | 1, mid + 1, r, L, R, a);
}
bool check(vector<Line>& v, int i, int j, int k) {
  return (long long)(v[i].b - v[j].b) * (v[k].k - v[i].k) >=
         (long long)(v[i].b - v[k].b) * (v[j].k - v[i].k);
}
void calc(vector<Line>& T) {
  int i, t;
  sort(T.begin(), T.end());
  for (i = 0, t = 0; i < (int)T.size(); ++i) {
    while ((t && T[S[t]].k == T[i].k) || (t > 1 && check(T, S[t - 1], S[t], i)))
      t--;
    S[++t] = i;
  }
  vector<Line> nxt;
  for (i = 1; i <= t; i++) nxt.push_back(T[S[i]]);
  T = nxt;
}
long long get(int x, int root) {
  if (!T[root].size()) return -INF;
  int l = 0, r = (int)T[root].size() - 2, res = 0;
  while (l <= r) {
    int mid = l + ((r - l) >> 1);
    if (T[root][mid].f(x) <= T[root][mid + 1].f(x)) {
      l = mid + 1;
      res = mid + 1;
    } else
      r = mid - 1;
  }
  return T[root][res].f(x);
}
void query(int root, int l, int r, int pos, int x) {
  res = max(res, get(x, root));
  if (l == r) return;
  int mid = l + ((r - l) >> 1);
  if (pos <= mid)
    query(root << 1, l, mid, pos, x);
  else
    query(root << 1 | 1, mid + 1, r, pos, x);
}
int main() {
  read(n);
  for (i = 1; i <= n; ++i) {
    read(c), read(seg[i].first);
    if (c == 1)
      read(seg[i].second);
    else if (c == 2) {
      int x = seg[i].first;
      add(1, 1, n, x, i, Line(seg[x].first, seg[x].second));
      seg[x].first = seg[i].first = DEL;
    } else
      op[++cnt] = make_pair(seg[i].first, i), seg[i].first = DEL;
  }
  for (i = 1; i <= n; ++i)
    if (seg[i].first != DEL) {
      add(1, 1, n, i, n, Line(seg[i].first, seg[i].second));
    }
  for (i = 1; i <= (n << 1); ++i)
    if (T[i].size()) calc(T[i]);
  for (i = 1; i <= cnt; ++i) {
    res = -INF;
    query(1, 1, n, op[i].second, op[i].first);
    if (res == -INF)
      puts("EMPTY SET");
    else
      printf("%lld\n", res);
  }
  return 0;
}
