#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string a[N];
  int acnt = 0;
  int wcnt = 0;
  int tcnt = 0;
  int rcnt = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (a[i] == "AC") {
      acnt++;
    } else if (a[i] == "WA") {
      wcnt++;
    } else if (a[i] == "TEL") {
      tcnt++;
    } else {
      rcnt++;
    }
  }
  cout << "AC x " << acnt << endl;
  cout << "WA x " << wcnt << endl;
  cout << "TLE x " << tcnt << endl;
  cout << "RE x " << rcnt << endl;
}
