#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[n];
  int cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == "AC")
      cnt1++;
    else if (s[i] == "TlE")
      cnt2++;
    else if (s[i] == "WA")
      cnt3++;
    else if (s[i] == "RE")
      cnt4++;
  }
  cout << "AC"
       << " "
       << "x"
       << " " << cnt1 << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << cnt2 << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << cnt3 << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << cnt4 << endl;
  return 0;
}
