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