#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
int main() {
  int n;
  cin >> n;
  string a[100];
  int AC, WA, TLE, RE = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == "AC") {
      AC++;
    } else if (a[i] == "TLE") {
      TLE++;
    } else if (a[i] == "WA") {
      WA++;
    } else if (a[i] == "RE") {
      RE++;
    }
  }
  cout << "AC x " << AC << endl
       << "WA x " << WA << endl
       << "TLE x " << TLE << endl
       << "RE x " << RE;
  return 0;
}
