#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << std::fixed;
  cout << std::setprecision(2);
  int n;
  cin >> n;
  map<char, int> m;
  for (int i = 0; i < n; ++i) {
    string second;
    cin >> second;
    m[second[0]]++;
  }
  cout << "AC X " << m['A'] << endl;
  cout << "WA X " << m['W'] << endl;
  cout << "TLE X " << m['T'] << endl;
  cout << "RE X " << m['R'] << endl;
  return 0;
}
