#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      c0++;
    else if (s == "WA")
      c1++;
    else if (s == "TLE")
      c2++;
    else
      c3++;
  }
  cout << "AC X " << c0 << '\n';
  cout << "WA X " << c1 << '\n';
  cout << "TLE X " << c2 << '\n';
  cout << "RE X " << c3;
  return 0;
}
