#include <bits/stdc++.h>
using namespace std;
int main() {
  int t1, a = 0, t = 0, w = 0, r = 0;
  cin >> t1;
  for (int i = 0; i < t1; i++) {
    string s;
    cin >> s;
    if (s[0] == 'A')
      a++;
    else if (s[0] == 'W')
      w++;
    else if (s[0] == 'T')
      t++;
    else if (s[0] == 'R')
      r++;
  }
  cout << "AC X " << a << endl;
  cout << "WA X " << w << endl;
  cout << "TLE X " << t << endl;
  cout << "RE X " << r << endl;
}
