#include <bits/stdc++.h>
const int N = 2e5 + 10;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  string s;
  long long cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
  while (n--) {
    cin >> s;
    if (s == "AC") {
      cnt1++;
    } else if (s == "TLE") {
      cnt3++;
    } else if (s == "WA") {
      cnt2++;
    } else {
      cnt4++;
    }
  }
  cout << "AC"
       << " " << 'x' << " " << cnt1 << "\n";
  cout << "WA"
       << " " << 'x' << " " << cnt3 << "\n";
  cout << "TLE"
       << " " << 'x' << " " << cnt2 << "\n";
  cout << "RE"
       << " " << 'x' << " " << cnt4 << "\n";
  return 0;
}
