#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < n; i++) 
using namespace std;
typedef long long ll;

int main() {

  int n;
  cin >> n;
  
  int c[n]={0};
  string t[4] = {"AC", "WA", "TLE", "RE"}; 
  string s;
  REP(i,n) {
    cin >> s;
    REP(j,4) {
      if (s == t[j]) c[j]++;
    }
  }
  
  REP(i,4) {
    cout << t[i] << " x " << c[i] << endl;
  }  
  
}
