#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a,w,t,r;
  for(int i=0;i<n;i++){
    string s;
    cin >> s;
    if(s == 'AC') a++;
    else if(s == 'WA') w++;
    else if(s == 'TLE') t++;
    else r++;
  }
  cout << "AC" << " x " << a << endl;
  cout << "WA" << " x " << w << endl;
  cout << "TLE" << " x " << t << endl;
  cout << "RE" << " x " << r << endl;

}