#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    string str1 = "WA", str2 = "AC", str3 = "TLE", str4 = "RE";
    long long n;
    cin >> n;
    string str;
    long long count1 = 0, count2 = 0, count3 = 0, count4 = 0;
    while (n--) {
      cin >> str;
      if (str == str1) count1++;
      if (str == str2) count2++;
      if (str == str3) count3++;
      if (str == str4) count4++;
    }
    cout << str1 << " x " << count2 << endl;
    cout << str2 << " x " << count1 << endl;
    cout << str3 << " x " << count3 << endl;
    cout << str4 << " x " << count4 << endl;
  }
  return 0;
}
