#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<string> s;
  vector<long long int> a(4, 0);
  string x;
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> x;
    s.push_back(x);
  }
  for (int(i) = 0; (i) < (n); (i)++) {
    if (s[i] == "AC")
      a[0]++;
    else if (s[i] == "WA")
      a[1]++;
    else if (s[i] == "TLE")
      a[2]++;
    else if (s[i] == "RE")
      a[3]++;
  }
  cout << "AC X " << a[0] << endl;
  cout << "WA X " << a[1] << endl;
  cout << "TLE X " << a[2] << endl;
  cout << "RE X " << a[3] << endl;
  return 0;
}
