#include<iostream>
#include<string>
using namespace std;

class TextProcessor {
    public:
    static int count;
    
    static bool isvalid(string s) {
        for(char c : s) {
            if(!((c >= 'a' && c <= 'z' || (c >= 'A' && c <='Z')))
            return false;
        }
        return true;
    }
    static string toUpper(string s) {
        for(char &c : s)
           if(c >= 'a' && c<= 'z') c -=32;
        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::count++;
        } else {
            cout << "invalid input" << endl;
        }
        if(n>=0) cout << "\n";
    }
    return 0;
}