#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,m,q; cin>>n>>m>>q; vector p(n); vector s(n); for(int i = 0;i>p[i]>>s[i]; } int mx = 2e5; const int B = 2500; vector> nnn(mx+1); vector> now(mx+1); vector l(q),r(q); vector ccc(mx+1,0); for(int i = 0;i>l[i]>>r[i]; l[i]--; } vector idx(q); for(int i = 0;i r[j]; return r[i] < r[j]; }); int ans = 0; int cnt = 0; int nl = 0; int nr = 1; vector> aa(q); if(s[0]=="AC"){ ans++; nnn[p[0]].insert(0); now[p[0]].push_front(0); }else{ now[p[0]].push_back(0); } for(int i = 0;ir[ni]){ nr--; if(s[nr]=="AC"){ now[p[nr]].pop_back(); nnn[p[nr]].erase(nr); if(nnn[p[nr]].size()==0){ cnt -= ccc[p[nr]]; ccc[p[nr]] = 0; ans--; } }else{ now[p[nr]].pop_back(); } } aa[ni] = make_pair(ans,cnt); //cout<