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