#include <bits/stdc++.h>
using namespace std;
const int MAXI = INT_MAX;
const long long MAXL = LLONG_MAX;
int n;
string s;
map<string, int> dd;
int main() {
  freopen("TASK.inp", "r", stdin);
  freopen("TASK.out", "w", stdout);
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    dd[s]++;
  }
  cout << "AC"
       << " "
       << "x"
       << " " << dd["AC"] << '\n';
  cout << "WA"
       << " "
       << "x"
       << " " << dd["WA"] << '\n';
  cout << "TLE"
       << " "
       << "x"
       << " " << dd["TLE"] << '\n';
  cout << "RE"
       << " "
       << "x"
       << " " << dd["RE"] << '\n';
  return 0;
}
