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