#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323846;
long long mod = 1000000007;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long a, b, c, d;
    a = b = c = d = 0;
    for (long long i = 0; i < n; i++) {
      string s;
      cin >> s;
      if (s == "AC")
        a++;
      else if (s == "WA")
        b++;
      else if (s == "TLE")
        c++;
      else if (s == "RE")
        d++;
    }
    cout << "AC X " << a << endl;
    cout << "WA X " << b << endl;
    cout << "TLE X " << c << endl;
    cout << "RE X " << d << endl;
  }
  return 0;
}
