#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    stringt str;
    int count=0;
    for(int i=0;i<n;i++)
    {
        cin>>str;
        bool valid=true;
        for(int j=0;j<str.length();j++)
        {
            if(!isalpha(str[j]))
            {
                valid=false;
                break;
            }
        }
        if(valid)
        {
            for(int j=0;j<str.length();j++)
            {
                str[j]=toupper(str[j]);
            }
            cout<<str>>endl;
            count++;
        }
        else
        {
            cout<<"Invalid input"<<endl;
        }
    }
    return 0;
}