import java.util.Scanner;

class TextProcessor {
    // Static variable to track successfully converted strings
    static int convertedCount = 0;

    // Static method to convert string to uppercase
    public static String toUpper(String str) {
        if (str == null || str.isEmpty()) {
            return null;
        }
        // Check for special characters or numbers
        for (char c : str.toCharArray()) {
            if (!Character.isLetter(c)) {
                return "Invalid input";
            }
        }
        convertedCount++;
        return str.toUpperCase();
    }
}

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        if (sc.hasNextInt()) {
            int n = sc.nextInt();
            sc.nextLine(); // Consume newline

            for (int i = 0; i < n; i++) {
                if (sc.hasNextLine()) {
                    String input = sc.nextLine();
                    String result = TextProcessor.toUpper(input);
                    System.out.println(result);
                }
            }
        }
        sc.close();
    }
}