#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0;
  cin >> t;
  int arr[4] = {0, 0, 0, 0};
  while (t--) {
    string s;
    cin >> s;
    switch (s[0]) {
      case 'A':
        arr[0]++;
        break;
      case 'W':
        arr[1]++;
        break;
      case 'T':
        arr[2]++;
        break;
      case 'R':
        arr[3]++;
        break;
    }
  }
  cout << "AC x" << arr[0] << endl;
  cout << "WA x" << arr[1] << endl;
  cout << "TLE x" << arr[2] << endl;
  cout << "RE x" << arr[3] << endl;
}
