#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, mod = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  map<string, int> mp;
  while (n--) {
    string s;
    cin >> s;
    ++mp[s];
  }
  cout << "AC x" << mp["AC"] << endl;
  cout << "WA x" << mp["WA"] << endl;
  cout << "TLE x" << mp["TLE"] << endl;
  cout << "RE x" << mp["RE"] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
