#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string str[100001];
  int cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> str[i];
    if (str[i] == "AC") {
      cnt1++;
    } else if (str[i] == "WA") {
      cnt2++;
    } else if (str[i] == "TLE") {
      cnt3++;
    } else if (str[i] == "RE") {
      cnt4++;
    }
    cout << "AC x " << cnt1 << endl;
    cout << "WA x " << cnt2 << endl;
    cout << "TLE x " << cnt3 << endl;
    cout << "RE x " << cnt4 << endl;
  }
  return 0;
}
