#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define N 100010 #define ll long long #define ALL(x) x.begin(),x.end() #define CLR(x,a) memset(x,a,sizeof(x)) #define bit(st,i) ((1ll< PI; const int INF=0x3fffffff; const int MOD =1000003; const double EPS=1e-7; string s,txt,input; char buf[N]; const char delim[3]={32,9,10}; bool isOpen(int i,int t){ return s[i+1]!='/' && s[t-1]!='/'; } bool isClose(int i){ return s[i+1]=='/'; } void printTxt(int top){ char *p=strtok(&txt[0],delim); if(p==NULL) return ; printf("%s%s",string(top,' ').c_str(),p); p=strtok(NULL,delim); while(p!=NULL){ printf(" %s",p); p=strtok(NULL,delim); } puts(""); } void format(){ int dep=-1; txt.clear(); for(int i=0;i0){ printTxt(dep+1); txt.clear(); } int t=i,top; while(s[t]!='>') t++; if(isOpen(i,t)) top=++dep; else if(isClose(i)) top=dep--; else top=dep+1; printf("%s%s\n",string(top,' ').c_str(),s.substr(i,t-i+1).c_str()); i=t; }else txt+=s[i]; } } int main(){ //freopen("output.txt","w",stdout); int re,Case=1,begin=0,end; scanf("%d",&re); while(gets(buf)) input+=" ", input+=buf; for(int i=1;i<=re;i++){ end=input.find("