#include <bits/stdc++.h>
const long long int M = 1000000000;
using namespace std;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fastio();
  int n;
  cin >> n;
  vector<int> v(4);
  string s;
  while (n--) {
    cin >> s;
    if (s == "AC")
      v[0]++;
    else if (s == "WA")
      v[1]++;
    else if (s == "TLE")
      v[2]++;
    else
      v[3]++;
  }
  cout << "AC X " << v[0] << endl;
  cout << "WA X " << v[1] << endl;
  cout << "TLE X " << v[2] << endl;
  cout << "RE X " << v[3] << endl;
}
