#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  string S;
  int A = 0, W = 0, T = 0, R = 0;
  for (int i = 0; i < N; i++) {
    cin >> S;
    if (S == "AC")
      A++;
    else if (S == "WA")
      W++;
    else if (S == "TLE")
      T++;
    else if (S == "RE")
      R++;
  }
  cout << "AC x " + "A" << endl;
  cout << "WA x " + "W" << endl;
  cout << "TLE x " + "T" << endl;
  cout << "RE x " + "R" << endl;
}
