#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using ll = long long int;
int a, b, c, d;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  int T;
  cin >> T;
  while (1) {
    string s;
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      b++;
    else if (s == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
  return 0;
}
