#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<string, int> mp;
  for (int(i) = 0; (i) < (N); (i)++) {
    string str;
    cin >> str;
    mp[str]++;
  }
  cout << "AC"
       << " x " << mp["AC"] << endl;
  cout << "WA"
       << " x " << mp["WA"] << endl;
  cout << "TLE"
       << " x " << mp["TLE"] << endl;
  cout << "RA"
       << " x " << mp["RA"] << endl;
  return 0;
}
