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