#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  char s[100000][10];
  for (int i = 0; i < N; i++) cin >> s[i][10];
  int ACcnt = 0;
  int WAcnt = 0;
  int TLEcnt = 0;
  int REcnt = 0;
  for (int i = 0; i < N; i++) {
    if (s[i][10] == 'AC')
      ACcnt++;
    else if (s[i][10] == 'WA')
      WAcnt++;
    else if (s[i][10] == 'TLE')
      TLEcnt++;
    else if (s[i][10] == 'RE')
      REcnt++;
  }
  cout << "AC x"
       << " " << ACcnt << endl;
  cout << "WA x"
       << " " << WAcnt << endl;
  cout << "TLE x"
       << " " << TLEcnt << endl;
  cout << "RE x"
       << " " << REcnt << endl;
  return 0;
}
