//Rosa Enciso
// Solution to 2007 BHCSI Contest #3 Problem reprint

import java.io.*;
import java.util.*;

public class reprint
{

	public static void main (String [] args) throws IOException
	{

		Scanner input = new Scanner(new File("reprint.in"));
		
		int numcases = input.nextInt();
		
		// Go through each case.
		for (int mycase=0; mycase<numcases; mycase++) {
			
			// Read in the word for this case.
			String word = input.next();
			int length = word.length();
			String word_changed = "";
		
			// Go through each leter.
			for(int i = 0;i<length;i++)
			{
				
				// Add each letter to the output string, one by one, based on
				// the rules given in the problem.
				if(word.charAt(i)%2 == 0)
				{
					word_changed += word.charAt(i);
				}
				else
				{
					word_changed += Character.toUpperCase(word.charAt(i));
				}
			}
			
			System.out.println(word_changed);
			
		}
		
		input.close();
	}	
}