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