#include <bits/stdc++.h>
using namespace std;
struct Node {
  long long x, y;
  Node(int a = 0, int b = 0) { x = a, y = b; }
  bool operator<(const Node &b) const {
    if (x == b.x)
      return y < b.y;
    else
      return x < b.x;
  }
  Node operator-(const Node &b) const { return Node(x - b.x, y - b.y); }
  long long operator*(const Node &b) const { return x * b.y - y * b.x; }
} v[300005];
long long ans;
int n, x, opt[300005], q[300005], End[300005];
vector<Node> t[1200005];
void update(int o, int l, int r, int x, int y, Node v) {
  if (x <= l && y >= r) {
    t[o].push_back(v);
  } else {
    int mid = l + r >> 1;
    if (x <= mid) update((o << 1), l, mid, x, y, v);
    if (y >= mid + 1) update((o << 1 | 1), mid + 1, r, x, y, v);
  }
}
void dfs(int o, int l, int r) {
  vector<Node> &v = t[o];
  if (!v.empty()) sort(v.begin(), v.end());
  if (v.size() > 2) {
    int i, j;
    for (i = 2, j = 1; i < v.size(); i++) {
      while (j > 0 && (v[j] - v[j - 1]) * (v[i] - v[j - 1]) >= 0) j--;
      v[++j] = v[i];
    }
    while (v.size() > j + 1) v.pop_back();
  }
  if (r == l) return;
  int mid = l + r >> 1;
  dfs((o << 1), l, mid), dfs((o << 1 | 1), mid + 1, r);
}
long long solve(vector<Node> &v, long long q) {
  long long ans = -2e18;
  int l = 0, r = v.size() - 1;
  while (r - l > 6) {
    int mid1 = (l * 2 + r) / 3;
    int mid2 = (l + r * 2) / 3;
    if (v[mid1].x * q + v[mid1].y > v[mid2].x * q + v[mid2].y)
      r = mid2;
    else
      l = mid1;
  }
  for (int i = l; i <= r; i++) ans = max(ans, v[i].x * q + v[i].y);
  return ans;
}
void query(int o, int l, int r, int x, int q) {
  ans = max(ans, solve(t[o], q));
  if (r == l) return;
  int mid = l + r >> 1;
  if (x <= mid)
    query((o << 1), l, mid, x, q);
  else
    query((o << 1 | 1), mid + 1, r, x, q);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", opt + i);
    if (opt[i] == 1) {
      scanf("%lld%lld", &v[i].x, &v[i].y);
      End[i] = n;
    } else if (opt[i] == 2) {
      scanf("%d", &x);
      End[x] = i - 1;
    } else if (opt[i] == 3) {
      scanf("%d", q + i);
    }
  }
  for (int i = 1; i <= n; i++)
    if (opt[i] == 1) update(1, 1, n, i, End[i], v[i]);
  dfs(1, 1, n);
  for (int i = 1; i <= n; i++) {
    if (opt[i] == 3) {
      ans = -2e18;
      query(1, 1, n, i, q[i]);
      if (ans <= -2e18)
        printf("EMPTY SET\n");
      else
        printf("%lld\n", ans);
    }
  }
  return 0;
}
