#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < (n); ++i) cin >> s[i];
  int ac = 0;
  int wa = 0;
  int tel = 0;
  int re = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == "AC")
      ac++;
    else if (s[i] == "WA")
      wa++;
    else if (s[i] == "TEL")
      tel++;
    else
      re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tel << endl;
  cout << "RE x " << re << endl;
  return 0;
}
