#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using P = pair<int, int>;
const int INF = 1e9;
const int E = numeric_limits<int>::min();
int main(void) {
  int N;
  cin >> N;
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  for (int i = 0; i < N; i++) {
    char *testCase;
    cin >> testCase;
    if (!strcmp(testCase, "AC")) {
      AC++;
    } else if (!strcmp(testCase, "WA")) {
      WA++;
    } else if (!strcmp(testCase, "TLE")) {
      TLE++;
    } else if (!strcmp(testCase, "RE")) {
      RE++;
    }
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
  return 0;
}
