#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> v(N);
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    if (s.at(0) == 'A') {
      v.at(0)++;
    } else if (s.at(0) == 'W') {
      v.at(1)++;
    } else if (s.at(0) == 'T') {
      v.at(2)++;
    } else if (s.at(0) == 'R') {
      v.at(3)++;
    }
  }
  cout << "AC x " << v.at(0) << endl;
  cout << "WA x " << v.at(1) << endl;
  cout << "TLE x " << v.at(2) << endl;
  cout << "RE x " << v.at(3) << endl;
}
