#include<iostream>
#include<string>
#include<cctype>
using namespace std;

class TextProcessor {
    private :
    static int successCount;
    public :
    
    static void processString(string str){
        for(char ch : str){
            if (!isalpha(ch)){
                cout<< "Invalid input" <<endl;
                return;
            }
        }
        for (char ch : str){
            ch = toupper(ch);
        }
        cout << str << endl;
        successCount++;
    }
    static int getSuccesCount(){
        return successCount;
    }
    
};
    int TextProcessor::sucessCount = 0;

int main(){
    int n;
    cin >> n;
    cin.ignore();
    
    string str;
    
    for (int i = 0; i< n; i++){
        getline(cin, str);
        TextProcessor::processString(str);
    }
    return 0;
}