#include<iostream>
#include<string>
#include<cctype>
using namespace std;

class TextProcessor {
    public:
    static int count;
    
    static bool isvalid(string s) {
        for(char c : s) {
            if(!isalpha(c)) return false;
        }
        return true;
    }
    static string toUpper(string s) {
        for(char &c : s) c = toUpper (c);
        return s;
    }
};

int  TextProcessor::count =0;

int main() {
    int n;
    cin >> n;
    cin.ignore();
    
    while(n--) {
        string s;
        getline(cin, s);
        
        if(TextProcessor::isvalid(s)) {
            cout <<  TextProcessor::toUpper(s) << endl;
             TextProcessor::cout++;
        }else{
            cout << "invalid input" <<endl;
        }
    }
    return 0;
}

   
    
    
}