#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  ;
  map<string, long long> m;
  for (long long i = 0; i <= n - 1; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC x " << m["AC"] << "\n";
  cout << "WA x " << m["WA"] << "\n";
  cout << "TLE x" << m["TLE"] << "\n";
  cout << "RE x" << m["RE"] << "\n";
  return 0;
}
