import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { static Map map = new HashMap(); public static void main(String[] args) { int t; Scanner cin = new Scanner(System.in); t=cin.nextInt(); while((t--)!=0) { String str = cin.next(); char st[] = new char[str.length()]; for(int i=0;i