#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main(){ int n,q; cin>>n; vector x(n); vector l(n),r(n); vector t; rep(i,n){ cin>>x[i]>>l[i]>>r[i]; r[i]++; t.push_back(l[i]); t.push_back(r[i]); } cin>>q; vector type(q); vector qx(q); vector a(q),b(q); rep(i,q){ cin>>type[i]; if(type[i]==1){ cin>>qx[i]; cin>>a[i]; t.push_back(a[i]); } if(type[i]==2){ cin>>a[i]; t.push_back(a[i]); } if(type[i]==3){ cin>>qx[i]; cin>>a[i]>>b[i]; b[i]++; t.push_back(a[i]); t.push_back(b[i]); } } sort(t.begin(),t.end()); t.erase(unique(t.begin(),t.end())); fenwick_tree F(t.size()+5); map> mp; rep(i,n){ mp[x[i]][l[i]] = r[i]; int d = distance(t.begin(),lower_bound(t.begin(),t.end(),l[i])); F.add(d,1); d = distance(t.begin(),lower_bound(t.begin(),t.end(),r[i])); F.add(d,-1); } rep(i,q){ if(type[i]==1){ /* auto it = mp[qx[i]].upper_bound(a[i]); if(it==mp[qx[i]].begin())cout<<"No"<first) <= a[i] && a[i] < (it->second))cout<<"Yes"<