#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, w = 0, t = 0, r = 0;
  cin >> n;
  cin.ignore();
  while (n--) {
    string st;
    getline(cin, st);
    if (st == "AC")
      a++;
    else if (st == "WA")
      w++;
    else if (st == "TLE")
      t++;
    else
      r++;
  }
  cout << "AC "
       << "x " << a << endl;
  cout << "WA "
       << "x " << w << endl;
  cout << "TLE "
       << "x " << t << endl;
  cout << "RA "
       << "x " << r << endl;
  return 0;
}
