// editor1
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
class textProcessor{
    public:
    static int count;
    static void TextProcessor(std::string str)
    {
        bool isValid = true;
        std::string upperStr = "";
        for(char c : str)
        {
            if((c>='a' && c<= 'z') || (c >='A' && c <='z'))
            {
                if(c >= 'a' && c <= 'z')
                upperStr +=(char)(c - 32);
            }
            else{
                upperStr += c;
            }
            else if(c ==''){
                upperStr +='';
            }
            else{
                isValid = false;
                break;
            }
            }
            if(isValid && !str.empty()){
                std::cout<< upperStr<<std::endl;
                count++;
            }
            else{
                std::cout<<"Invalid input"<<std::endl;
            }
        }
    }
};
int TextProcesssor::count = 0;
int main(){
    int n;
    if(!(std::cin>>n))return 0;
    std::cin.ignore();
    for(int i = 0;i < n;i++){
        std::string input;
        std::getline(std::cin,input);
        Textprocessor::processText(input);
    }
    return 0;
}