#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "AC")
      m[0]++;
    else if (s == "WA")
      m[1]++;
    else if (s == "TLE")
      m[2]++;
    else if (s == "RE")
      m[3]++;
  }
  cout << "AC x " << m[0] << "\n";
  cout << "TLE x " << m[1] << "\n";
  cout << "WA x " << m[2] << "\n";
  cout << "RE x " << m[3] << "\n";
  return 0;
}
