import java.util.ArrayDeque; import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) throws Exception { new Main().run(); } void run() { Scanner sc=new Scanner(System.in); int T=sc.nextInt(); for(int t=0;t dq=new ArrayDeque<>(); char[] cs=sc.next().toCharArray(); for(int i=0;i1) { int n=dq.size(); for(int i=0;i