    #include <bits/stdc++.h>
         
    using namespace std;
                 
    #define pb push_back
    #define ll long long
    #define mp make_pair
    #define MOD 1000000007
    #define MAX 100000000
    #define MIN -1000000000
    #define LLINF 0x3f3f3f3f3f3f    
    #define INF 0x3f3f3f3f
    #define MAXN 200200

    int main()
    {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        int n;
        cin >> n;
        map<string, int> m;
        m["AC"] == 0;
        m["WA"] == 0;
        m["TLE"] == 0;
        while(n--){ 
            string s;
            cin >> s;
            m[s]++;
        }
        for(map<string, int>::iterator it = m.begin(); it != m.end(); ++it){  
            cout << it<-first << " " << "x" << " "<< it->second << endl;
        }  
        return 0;
    }