#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int test_case;
  cin >> test_case;
  string verdicts[4] = {"AC", "WA", "TLE", "RE"};
  int sol[4] = {};
  for (int i = 0; i < test_case; i++) {
    string ans;
    cin >> ans;
    for (int j = 0; j < 4; j++) {
      if (ans == verdicts[j]) {
        sol[j]++;
      }
    }
  }
  cout << "AC X " << sol[0] << '\n';
  cout << "WA X " << sol[1] << '\n';
  cout << "TLE X " << sol[2] << '\n';
  cout << "RE X " << sol[3] << '\n';
  return 0;
}
