#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const long long INF = -(long long)2e18 - 1;
struct point {
  int x, y;
  point(int x = 0, int y = 0) : x(x), y(y) {}
  long long calc(long long q) { return q * x + y; }
} pt[N];
point operator-(point p, point q) { return point(p.x - q.x, p.y - q.y); }
long long operator*(point p, point q) {
  return (long long)p.x * q.y - (long long)p.y * q.x;
}
bool operator<(point p, point q) {
  if (p.x != q.x) return p.x < q.x;
  return p.y < q.y;
}
vector<point> v[N << 2];
void update(point p, int L, int R, int l, int r, int rt) {
  if (l >= L && r <= R) {
    v[rt].push_back(p);
    return;
  }
  int m = l + r >> 1;
  if (m >= L) update(p, L, R, l, m, rt << 1);
  if (m < R) update(p, L, R, m + 1, r, rt << 1 | 1);
}
int vis[N], q[N];
long long ans[N];
void construct(int rt) {
  sort(v[rt].begin(), v[rt].end());
  if (v[rt].size() < 3) return;
  vector<point>& t = v[rt];
  int i = 1, j = 2, c = 2;
  while (j < t.size()) {
    if (i > 0 && (t[i] - t[i - 1]) * (t[j] - t[i - 1]) >= 0) {
      i--;
      c--;
    } else {
      t[++i] = t[j];
      j++;
      c++;
    }
  }
  t.resize(c);
}
long long search(int q, int rt) {
  vector<point>& t = v[rt];
  int l = 0, r = t.size() - 1, ml, mr;
  while (r - l > 2) {
    int len = (r - l + 1) / 3;
    ml = l + len;
    mr = l + 2 * len;
    if (t[ml].calc(q) < t[mr].calc(q)) {
      l = ml;
    } else {
      r = mr;
    }
  }
  long long mx = INF;
  for (int i = l; i <= r; i++) {
    long long tmp;
    if ((tmp = t[i].calc(q)) > mx) {
      mx = tmp;
    } else
      break;
  }
  return mx;
}
void query(int l, int r, int rt) {
  construct(rt);
  for (int i = l; i <= r; i++) {
    if (vis[i] == 0) {
      ans[i] = max(ans[i], search(q[i], rt));
    }
  }
  if (l == r) return;
  int m = l + r >> 1;
  query(l, m, rt << 1);
  query(m + 1, r, rt << 1 | 1);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    ans[i] = INF;
    int t;
    cin >> t;
    if (t == 1) {
      vis[i] = 2;
      cin >> pt[i].x >> pt[i].y;
    } else if (t == 2) {
      int x;
      cin >> x;
      vis[x] = 1;
      vis[i] = 1;
      update(pt[x], x, i - 1, 1, n, 1);
    } else {
      cin >> q[i];
    }
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 2) {
      update(pt[i], i, n, 1, n, 1);
    }
  }
  query(1, n, 1);
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      if (ans[i] == INF)
        cout << "EMPTY SET\n";
      else
        cout << ans[i] << endl;
    }
  }
  return 0;
}
