#include #include using namespace std; string s; int main(){ int t; cin>>t; while(t--){ stack a; cin.ignore(); getline(cin,s); for(int i=0;i