#include <iostream>
#include <string>
#include <cctype>
using namespace std;

class TextProcessor {
private:
    static int count;
    
public:
        static void convertToUpper(string str)
    {
        bool valid = true;
        
        for (int i = 0; i< str.length();
i++) {
            if (!isalpha(str[i])) {
                valid = false;
                break;
            }
        }
    }
    if (!valid) {
        cout <<"Invalid input" <<
endl;
        }else{
            for (int i =0; i <
str.length(); i++) {
                 str[i] = toupper(str[i]);
                 count++;
        }
    }
    
    static int getCount() {
        return count;
    }
};

int TextProcessor::count = 0;

int main() {
    int n;
    cin >> n;
    cin.ignore();
    
    for (int i = 0; i < n; i++) {
        string str;
        getline(cin, str);
TextProcessor::convertToUpp
    }