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