#include<iostream>
#include<string>
#include<cctype>
using namespace std;

int main() {
    string input;
    int testCase;
    
    cout << "Enter number of test cases: ";
    cin >> testCase;
    cin.ignore();
    for(int i = 1; i <= testCase; i++) {
        cout << "Sample Input " << i << ":" << endl;
        
        int totalChars = input.length();
        int words = 0;
        int numbers = 0;
        int special = 0;
        
        for(char c : input) {
            if
            (isdigit(c)) numbers++;
            else if(!isalnum(c)) sepical++;
        }
        bool inWord = false;
        for(char c : input) {
            if(isalpha(c)) {
                inWord = true;
            }
            else if(inWord && (c == ' ' || c == '\t' || c == '\n')) {
                words++
                inWord = false;
            }
        }
        if(inWord) words++;
        cout<<"Sample Output " << i << ":" << endl;
        cout<<"Total characters: "<< totalChars << endl;
        cout <<"Words: "<< words << endl;
        cout <<"Numbers: "<< numbers << endl;
        cout <<"Special characters: "<< special << endl << endl;
        
    }
    return 0;
}