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