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