#include <bits/stdc++.h>
using namespace std;
const int N = 301010;
int n, op[N], a[N], b[N], c[N];
vector<pair<int, int> > v[N << 1];
void Ins(int l, int r, int L, int R, pair<int, int> p) {
  int c = (l + r) | (l != r), mid = (l + r) >> 1;
  if (L <= l && r <= R)
    v[c].push_back(p);
  else {
    if (L <= mid) Ins(l, mid, L, R, p);
    if (R > mid) Ins(mid + 1, r, L, R, p);
  }
}
long long ans;
bool vis[N << 1];
long long cross(pair<int, int>& a, pair<int, int>& b, pair<int, int>& c) {
  return (long long)(b.first - a.first) * (c.second - a.second) -
         (long long)(c.first - a.first) * (b.second - a.second);
}
long long gt(pair<int, int>& a, long long p) { return a.first * p + a.second; }
void Query(int c, vector<pair<int, int> >& v, int p) {
  if ((int)(v).size() == 0) return;
  if (!vis[c]) {
    vis[c] = true;
    sort((v).begin(), (v).end());
    vector<pair<int, int> > nv;
    for (int i = 0; i < ((int)(v).size()); ++i) {
      while ((int)(nv).size() >= 2 &&
             cross(nv[(int)(nv).size() - 2], nv[(int)(nv).size() - 1], v[i]) >=
                 0)
        nv.pop_back();
      nv.push_back(v[i]);
    }
    v = nv;
  }
  int l = -1, r = (int)(v).size() - 1;
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    if (gt(v[mid], p) >= gt(v[mid + 1], p))
      r = mid;
    else
      l = mid;
  }
  ans = max(ans, gt(v[r], p));
}
void Query(int l, int r, int x, int p) {
  int c = (l + r) | (l != r), mid = (l + r) >> 1;
  Query(c, v[c], p);
  if (l == r)
    return;
  else if (x <= mid)
    Query(l, mid, x, p);
  else if (x > mid)
    Query(mid + 1, r, x, p);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < (n + 1); ++i) {
    scanf("%d%d", op + i, a + i);
    if (op[i] == 1)
      scanf("%d", b + i), c[i] = n;
    else if (op[i] == 2)
      c[a[i]] = i;
  }
  for (int i = 1; i < (n + 1); ++i)
    if (op[i] == 1) Ins(1, n, i, c[i], make_pair(a[i], b[i]));
  for (int i = 1; i < (n + 1); ++i)
    if (op[i] == 3) {
      ans = -(1ll << 62);
      Query(1, n, i, a[i]);
      if (ans == -(1ll << 62))
        puts("EMPTY SET");
      else
        printf("%I64d\n", ans);
    }
  return 0;
}
