public static void main(String[] args) {	
		
		Scanner sc = new Scanner(System.in);
		
		int tests = sc.nextInt();
		String []in = new String[tests];
		int i=0;
		while(tests>0 && i<in.length){
			tests--;
			in[i] = sc.next();
			i++;
		}
		
		for (String str : in){
			System.out.println(solve(str));
		}	
		sc.close();
		
	}