#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S[N];
  for (int i = 0; i < N; i++) cin >> S[i];
  int ans[4];
  string res[4] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 4; j++)
      if (S[i].compare(res[j]) == 0) ans[j]++;
  }
  cout << "AC x " << ans[0] << endl;
  cout << "WA x " << ans[1] << endl;
  cout << "TLE x " << ans[2] << endl;
  cout << "RE x " << ans[3] << endl;
}
