#include <bits/stdc++.h>
using namespace std;
int cnt[12];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    if (s == "AC") {
      cnt[1]++;
    } else if (s == "WA") {
      cnt[2]++;
    } else if (s == "TLE") {
      cnt[3]++;
    } else if (s == "RE") {
      cnt[4]++;
    }
  }
  cout << "AC"
       << " X " << cnt[1] << "\n";
  cout << "WA"
       << " X " << cnt[2] << "\n";
  cout << "TLE"
       << " X " << cnt[3] << "\n";
  cout << "RE"
       << " X " << cnt[4] << "\n";
  return 0;
}
