#include <bits/stdc++.h>
using namespace std;
long long int binpow(long long int a, long long int b) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
void solve() {
  long long int n;
  cin >> n;
  map<string, long long int> s;
  for (long long int i = 0; i < n; i++) {
    string x;
    cin >> x;
    s[x]++;
  }
  cout << "AC x " << s["AC"] << "\n";
  cout << "TLE x " << s["WA"] << "\n";
  cout << "WA x " << s["TLE"] << "\n";
  cout << "RE x " << s["RE"] << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
