#include<bits/stdc++.h>usingnamespacestd;constintN=200005;structTre{intl,r,id,a,e,eid;inttagid,taga,tage,tageid; }t[N*50];intrt=0,cnt=0,n,m,k,rd[N][5],jk[N*8];voiddown(intu){int&ls=t[u].l;int&rs=t[u].r;if(ls==0){ ls=++cnt; t[ls].e=0; t[ls].id=t[l...