#include<iostream>
#include<string>
#include<cctype>
using namespace std;

class TextProcessor
{
    private:
    static int count;
    
    public:
    static void ConvertToUpper(string str)
    {
        bool v=true;
        for(inti=0;i<str.lenght();i++)
        {
            for(!(str[i]>='a'&& str[i]<='z'))||(str[i]>='A'&& str[i]<=Z);
            valid=false;
            break;
        }
    } 
    if(valid)
    op{
        for(int i=0;i<str.lenght();i++)
        {
            str[i]=toupper(str[i]);
        }
        cout<<str<<endl;
        cout++;
    }
    else
    {
        cout<<"Invalid input";
    }
};
int TextProcessor::count=0;
int main()
{
    int n;
    cin>>n;
    cin.ignore();
    string str;
    for(int i=0;i<n;i++)
    {
        cin>>str;
        TextProcessor::ConvertToUpper(str);
    }
    return 0;
}