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