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