#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    string s;
    int a = 0, b = 0, c = 0, d = 0;
    for (int i = 0; i < n; i++) {
      cin >> s;
      if (s == "AC")
        a++;
      else if (s == "TLE")
        b++;
      else if (s == "WA")
        c++;
      else
        d++;
    }
    cout << "AC"
         << "x" << a << endl;
    cout << "WA"
         << "x" << c << endl;
    cout << "TLE"
         << "x" << b << endl;
    cout << "RTA"
         << "x" << d << endl;
  }
  return 0;
}
