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