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