#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  string s;
  int a = 0, b = 0, c = 0, d = 0;
  while (t--) {
    cin >> s;
    if (!s.compare("AC"))
      a++;
    else if (!s.compare("WA"))
      b++;
    else if (!s.compare("TLE"))
      c++;
    else if (!s.compare("RE"))
      d++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << a << endl;
  cout << "TLE x " << a << endl;
  cout << "RE x " << a << endl;
  return 0;
}
