#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int AC = 0, WA = 0, RE = 0, TLE = 0;
  string s;
  for (int i = 0; i < N; i++) {
    cin >> s;
    if (s.compare("AC") == 0) {
      AC++;
    } else if (s.compare("WA") == 0) {
      WA++;
    } else if (s.compare("RE") == 0) {
      RE++;
    } else {
      TLE++;
    }
  }
  cout << "AC x " << AC << endl
       << "WA x " << WA << endl
       << "TLE x " << endl
       << "RE x " << RE << endl;
}
