#include <bits/stdc++.h>
using namespace std;
struct node {
  long long x, y;
  void input() { scanf("%I64d%I64d", &x, &y); }
  node operator+(const node& tt) const { return node(x + tt.x, y + tt.y); }
  node operator-(const node& tt) const { return node(x - tt.x, y - tt.y); }
  long long operator^(const node& tt) const { return x * tt.y - y * tt.x; }
  long long operator*(const node& tt) const { return x * tt.x + y * tt.y; }
  bool operator<(const node& tt) const {
    if (x != tt.x) return x < tt.x;
    return y < tt.y;
  }
  node(long long a = 0, long long b = 0) : x(a), y(b) {}
} tmp[300005], stk[300005];
vector<node> t[300005 << 2];
int n, q[300005], id[300005], l[300005], r[300005], cc = 0;
void update(int r, int L, int R, int ll, int rr, const node& tt) {
  int mid = L + R >> 1;
  if (L == ll && R == rr) {
    t[r].push_back(tt);
    return;
  }
  if (rr <= mid)
    update(r << 1, L, mid, ll, rr, tt);
  else if (ll > mid)
    update(r << 1 | 1, mid + 1, R, ll, rr, tt);
  else {
    update(r << 1, L, mid, ll, mid, tt);
    update(r << 1 | 1, mid + 1, R, mid + 1, rr, tt);
  }
}
long long ans[300005];
long long calc(int l, int r, int x) {
  int m1, m2;
  node tt(x, 1);
  while (l < r) {
    m1 = l + r >> 1;
    m2 = m1 + r + 1 >> 1;
    if (stk[m1] * tt < stk[m2] * tt)
      l = m1 + 1;
    else
      r = m2 - 1;
  }
  return stk[l] * tt;
}
void solve(int r, int L, int R) {
  int top = 0, mid = L + R >> 1;
  if (L < R) {
    solve(r << 1, L, mid);
    solve(r << 1 | 1, mid + 1, R);
  }
  sort(t[r].begin(), t[r].end());
  for (int i = 0, j = t[r].size(); i < j; ++i) {
    while (top > 1 &&
           ((stk[top - 1] - stk[top - 2]) ^ (t[r][i] - stk[top - 2])) >= 0)
      --top;
    stk[top++] = t[r][i];
  }
  for (int i = L; i <= R; ++i)
    if (q[i] <= 1e9 && top) ans[i] = max(ans[i], calc(0, top - 1, q[i]));
}
int main() {
  memset(q, 0x7f, sizeof(q));
  scanf("%d", &n);
  int c, a, b;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &c);
    if (c == 3) {
      scanf("%d", q + i);
      ans[i] = -9.05e18;
      continue;
    }
    if (c == 1) {
      id[i] = ++cc;
      tmp[cc].input();
      l[cc] = i;
      r[cc] = n;
    } else {
      scanf("%d", &a);
      r[id[a]] = i - 1;
    }
  }
  for (int i = 1; i <= cc; ++i) update(1, 1, n, l[i], r[i], tmp[i]);
  solve(1, 1, n);
  for (int i = 1; i <= n; ++i)
    if (q[i] <= 1e9) {
      if (ans[i] < -9e18)
        puts("EMPTY SET");
      else
        printf("%I64d\n", ans[i]);
    }
  return 0;
}
