#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
using namespace std;
const double PI = acos(-1);
long long gcd() { return 0ll; }
template <typename T, typename... Args>
T gcd(T a, Args... args) {
  return __gcd(a, (__typeof(a))gcd(args...));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    int n;
    cin >> n;
    string s;
    map<string, int> m;
    for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
         i += 1 - 2 * ((0) > (n)))
      cin >> s, m[s]++;
    cout << "AC " << m["AC"] << "\n";
    cout << "WA " << m["WA"] << "\n";
    cout << "TLE " << m["TLE"] << "\n";
    cout << "RE " << m["RE"] << "\n";
  }
  return 0;
}
