#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> cnt(4, 0);
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if (S == "AC") {
      cnt[0]++;
    }
    if (S == "WA") {
      cnt[1]++;
    }
    if (S == "TLE") {
      cnt[2]++;
    }
    if (S == "RE") {
      cnt[0]++;
    }
  }
  cout << "AC x " << cnt[0] << endl;
  cout << "WA x " << cnt[1] << endl;
  cout << "TLE x " << cnt[2] << endl;
  cout << "RE x " << cnt[3] << endl;
}
