#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int arr[6] = {0};
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s[0] == 'A') {
      arr[0]++;
    } else if (s[0] == 'T') {
      arr[1]++;
    } else if (s[0] == 'W') {
      arr[2]++;
    } else
      arr[3]++;
  }
  cout << "AC x " << arr[0] << "\n";
  cout << "WA x " << arr[2] << "\n";
  cout << "TLE x " << arr[1] << "\n";
  cout << "RE x " << arr[4] << "\n";
  return 0;
}
