#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  vector<long long int> v;
  long long int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  char s1[] = "AC";
  char s2[] = "WA";
  char s3[] = "TLE";
  char s4[] = "RE";
  while (t--) {
    char s[100005];
    cin >> s;
    if (strcmp(s1, s) == 0) {
      c1 += 1;
    } else if (strcmp(s2, s) == 0) {
      c2 += 1;
    } else if (strcmp(s3, s) == 0) {
      c3 += 1;
    } else if (strcmp(s4, s) == 0) {
      c4 += 1;
    }
  }
  cout << "AC X " << c1 << endl;
  cout << "WA X " << c2 << endl;
  cout << "TLE X " << c3 << endl;
  cout << "RE X " << c4 << endl;
}
