#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
using ll = long long;
int main() {
  int N;
  cin >> N;
  int c_ac, c_wa, c_tle, c_re = 0;
  for (int i = 0; i < (int)(N); i++) {
    string S;
    cin >> S;
    if (S == "AC") {
      c_ac++;
    } else if (S == "WA") {
      c_wa++;
    } else if (S == "TLE") {
      c_tle++;
    } else {
      c_re++;
    }
  }
  cout << "AC x " << c_ac << endl;
  cout << "WA x " << c_wa << endl;
  cout << "TLE x " << c_tle << endl;
  cout << "RE x " << c_re << endl;
  return 0;
}
