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