#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  int a, b, c, d = 0;
  for (int i = 0; i < (int)(n); i++) {
    cin >> s;
    if (s[0] == 'A')
      a++;
    else if (s[0] == 'W')
      b++;
    else if (s[0] == 'T')
      c++;
    else
      d++;
  }
  cout << "AC x " << a << endl
       << "WA x " << b << endl
       << "TLE x " << c << endl
       << "RE x " << d << endl;
  return 0;
}
