#include <bits/stdc++.h>
using namespace std;
long long t, n, m, k, x, y, sum, con, ans;
long long a, b;
pair<long long, long long> p;
map<string, long long> mp;
vector<long long> v;
set<long long> st;
set<long long>::iterator it;
string s;
int main() {
  ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> s;
    mp[s]++;
  }
  cout << "AC x " << mp["AC"] << '\n';
  cout << "WA x " << mp["WA"] << '\n';
  cout << "TLE x " << mp["TLE"] << '\n';
  cout << "RE x " << mp["RE"] << '\n';
}
