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