#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  map<string, int> mp;
  cin >> t;
  cin.ignore();
  while (t--) {
    string str;
    getline(cin, str);
    mp[str]++;
  }
  cout << "AC x " << mp["AC"] << "\n";
  cout << "WA x " << mp["WA"] << "\n";
  cout << "TLE x " << mp["TLE"] << "\n";
  cout << "RTE x " << mp["RTE"] << "\n";
}
