#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
using ll = long long;
int n, tp[N], x[N], y[N];
ll ans[N], q[N];
bool vis[N];
struct TNode {
  int l, r;
  vector<pair<int, int>> v;
} t[N << 2];
inline int lc(int pos) { return pos << 1; }
inline int rc(int pos) { return pos << 1 | 1; }
void build(int pos, int l, int r) {
  t[pos].l = l;
  t[pos].r = r;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(lc(pos), l, mid);
  build(rc(pos), mid + 1, r);
}
void ins(int pos, int l, int r, pair<int, int> v) {
  if (t[pos].l == l && t[pos].r == r) {
    t[pos].v.push_back(v);
    return;
  }
  int mid = (t[pos].l + t[pos].r) >> 1;
  if (r <= mid)
    ins(lc(pos), l, r, v);
  else if (l > mid)
    ins(rc(pos), l, r, v);
  else
    ins(lc(pos), l, mid, v), ins(rc(pos), mid + 1, r, v);
}
pair<int, int> p[N];
int ptr;
void query(int pos) {
  int l = 0, r = ptr - 1;
  while (l <= r - 3) {
    int mid1 = (l + l + r) / 3, mid2 = (l + r + r) / 3;
    if (p[mid1].first * q[pos] + p[mid1].second <
        p[mid2].first * q[pos] + p[mid2].second)
      l = mid1;
    else
      r = mid2;
  }
  for (int i = l; i <= r; i++)
    ans[pos] = max(ans[pos], p[i].first * q[pos] + p[i].second);
}
inline double slope(pair<int, int> x, pair<int, int> y) {
  return (x.second - y.second) / 1.0 / (x.first - y.first);
}
void solve(int l, int r, int pos = 1) {
  int mid = (l + r) >> 1;
  if (l < r) solve(l, mid, lc(pos)), solve(mid + 1, r, rc(pos));
  sort(t[pos].v.begin(), t[pos].v.end());
  ptr = 0;
  for (auto &i : t[pos].v) {
    while (ptr > 1 && (p[ptr - 1].first == i.first ||
                       slope(i, p[ptr - 1]) >= slope(p[ptr - 1], p[ptr - 2])))
      --ptr;
    p[ptr++] = i;
  }
  for (int i = l; i <= r; i++)
    if (tp[i] == 3) query(i);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  build(1, 1, n);
  for (int i = 1; i <= n; i++) {
    cin >> tp[i];
    int t;
    if (tp[i] == 1)
      cin >> x[i] >> y[i];
    else if (tp[i] == 2)
      cin >> t, ins(1, t, i - 1, {x[t], y[t]}), vis[t] = 1;
    else
      cin >> q[i], ans[i] = LLONG_MIN;
  }
  for (int i = 1; i <= n; i++)
    if (tp[i] == 1 && !vis[i]) ins(1, i, n, {x[i], y[i]});
  solve(1, n);
  for (int i = 1; i <= n; i++)
    if (tp[i] != 3)
      continue;
    else if (ans[i] == LLONG_MIN)
      cout << "EMPTY SET" << endl;
    else
      cout << ans[i] << endl;
  return 0;
}
