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